So, sometimes bug hunters, we find bugs, like we work really hard to find bugs, but sometimes we're lucky and bugs find us. So my talk is about luck, in a way. So let's start. I have to admit, I grew up using PowerPoint. So I'm still using PowerPoint for my slides. I'm not using Google Slides or any modern application. And I'm the kind of guy where black on white is perfect, but I know it's not always visually appealing. So in PowerPoint, there's a feature called, I think, Design Suggestions, where it's an AI-based feature and it suggests, based on your contents, a slide, a template for you, where it's just a couple of designs. So I picked one. This morning, I noticed that Microsoft thinks that Canada, we live in igloos. So it shows my name, based out of Montreal, Canada. I don't live in an igloo. They should just put a house, like, I don't know. Anyway, so my name is Jasmine Landry. I'm a French-Canadian. In English, my name is, I guess, Jasmine, or as my friends call me, Jazz. I'm currently a full-time bug bounty hunter. I've been doing it for almost a year now. I've been in IT and cybersecurity for, I think, 12 years. Before doing a bounty full-time, I worked at NASDAQ as a senior director, information security. I used to manage the AppSec team, did some... My team also did the pentesting and red teaming. And as a typical Canadian, I'm an avid hockey player and a hockey fan, so go Habs go. So this is about when bugs show up on your doorstep. It's not about like recon or crazy exploit chains. I may have one that's pretty cool, like something crazy like what James Kettle did yesterday. It's about those weird, funny, or chaotic bugs that are often unexpected, but as a bug hunter, they're always welcome. So here's what you're in for. I divided this talk in three sections. The first one is luck, bugs that got dropped in my lap, pretty much. WTF, bugs that kind of made no sense to me when I found them, and LOL, so bugs that are so ridiculous, it just like kind of made me laugh. And then in the end, Q&A if we have time. So let's start off with luck. And in bug bounty, when we get lucky, it's often where it's something that is unexpected, like a blind XSS, we just like put a payload and maybe eventually it'll pop and we'll get something cool. So the first two bugs on the luck side of things are both blind XSS. So what was I looking at back then? It was a cloud compliance application. So like it was an app where we could test if our infrastructure was like SOC 2 compliant or ISO 27001, all of that. It was quite hard. I only had like one or two bugs, both or I don't remember if it was one or two, but low or medium, not really impactful. So I decided to just like spray and pray payloads all over the place. If you're not familiar with the term spray and pray, it's pretty much just like spraying payloads and praying that one will work, right? So I did that. And obviously one of them did work. Back then I used XSS Hunter as my XSS, my XSS tool. So with that tool, it captures like the URL, cookies, you can download the DOM. There's also a screenshot you can get with that. So the URL was this, X, Apple, QLID, UUID, and then like X, Apple, QL Magic. It was like, that's pretty odd. I've never seen that before. And then I look at the screenshot, it's an actual CSV file, not like a webpage or HTML file. That's really weird. In that file, there were like org IDs, AWS account IDs, partial credit card data, and other not as sensitive data. And inside the DOM that I was about to download, there was this specific string, quick look CSV. So by putting all of these pieces together, I learned that the QL in the X, Apple, QLID, I guess URI scheme was actually quick look. So quick look is a feature in Mac where they can preview files. So what is quick look CSV? Well, it's a plugin for quick look in Mac. So it's specifically for CSV files. Now, I'm not sure if you guys can see well, but the main.c file, the last commit or last modification was 16 years ago. I was like, interesting. The last actual change was eight years ago on the license file. So it was pretty old. So I tested it out locally and it was actually vulnerable, just like using brew install, whatever it was, and it worked. So what did I, what was the result of this? I'll read out what I got as a message from the program on the bug match platform. That was bug road. So he said, even though this isn't a vulnerability in our application per se, we are considering this a P1, additionally eligible for the bonus listed in our brief because you managed to get access to some data about our customer accounts in there. What's happened is some people in our org were running a microservice, which exported data from the production environment and viewed the export on their machine using this quick look CSV vulnerable software. So we want to reward you for bringing the issue where production data being transmitted outside our production environment to our intention. So since there was like credit card data in there, PCI was gonna knock on the door, maybe eventually. I also got a bonus for getting access to customer data. And I was the only researcher that reported it despite having many other blindness payloads in that file. And what's funny about that is that I remember getting the alert like on a Friday evening and took me a while to figure out what company it was. And they eventually reported it two days later on Sunday. So lesson learned with that on my end is when I spray payloads, make sure I can identify where the input is coming from. But that was like when I started like 2018 to 19. I'm not doing that anymore. Now I'm more, I guess, experienced. So I do identify my payloads. Additionally, we previously classed several of the submissions from researchers as low priority based on how difficult it would be to guess a number of customer accounts or org IDs. And I managed to get a whole dump of it. It was like a thousand line file. So it was like a big dump. And lastly, I want to tell you that internally I received, make sure your reward is finding messages from technical lead, head of security and CTO. Is that one person? I don't know. Is it three? I'm hoping it's three, you know, it's more cool. But I found that pretty cool to get that on a message in a bug bounty, I guess on a report. So bug number two, what are we looking at now? This is another hardened app. This time was built on Rails. And at first sight, it didn't seem vulnerable to XSS. It was a large company. So I figured maybe to have like processes in place where they would take my input and, you know, transfer it elsewhere. So I figured, what do I do? Sprint for your payloads again. And obviously it worked out. I got a second blank XSS payload, a blank XSS pop. And this time, what was captured in XSS Hunter, the URL was also not something usual. It was about source doc, which I was like, hmm, that's kind of odd. And the screenshot showed this. Let me just, actually, yeah, I can't really change it, but it looks like an email, right? We can see like this sent from to one subject and the body of the email. And the subject says, please investigate customer ID. I was like, that's really weird. But if you look at the email itself, it says, you and your friends ruined a fine experiment. You should be ashamed of yourself. And then my XSS payload. And then it said like, it didn't apply with instructions. So what happened? Because of my spring of payloads, someone filed a complaint on my account. And the complaint, which contained my XSS payload, popped in like an internal email system. So because of that guy that filed a complaint, I got a nice four-digit bounty. And funny story related to that, a couple of days after I reported it, he messaged me on Twitter. I figured I had my JROC name somewhere in the application. And he was like, man, you ruined my day. I wish a lot of time on what you did. And I was like, what did I do? He was like, you did a ton of BS stuff. And anyways, I was like, well, sorry, man. I'm just doing bug bounty. Like, here's a platform. I'm authorized to do this. Like, this is legit stuff. I was like, oh, you do bug bounty. That's pretty cool. Take a look at this. I was like, awesome. Bring it to me, man. So he was actually like telling me like places where for him it looked weird. And so in the end, he was a really cool guy. And I just, I guess he had a bad day and all that stuff. So it's a funny, funny story. So now the WTF bugs. So what are we looking at? I was participating in an LHE, so a live hacking event. This was a really huge scope. So I just picked a random application, but to log in, I had to be an employee. So obviously I didn't have credentials, so I couldn't log in. I tried everything that I could think of to bypass authentication, like LDAP injection or, you know, regular like odd bypasses, tricks and stuff, but nothing worked. So what did I do? No, I didn't just pray and pray and blindly accept all this time. I did some fuzzing though, to try to see if, you know, something could happen, you know, injecting Unicode characters and anything that I could think of with fuzzing, but nothing worked. However, one week later, I got an email. I don't have a screenshot of the email anymore, but I'll show you what I wrote in the report. I'm not exactly sure what happened, but it seemed that my research email jrockatwearehacker.com has been added in a group that received new access requests from and then redacted domain. So what happened here? I somehow got added in an internal distribution list. So in the email, we could see like a dozen like employees in the tool field, and then in there, there was my hacker email address. And in those emails, well, actually I couldn't still, I still couldn't access the application for some reason. I was like an admin, but I still have a legit login, but I could most likely approve or deny users access requests. What was in those emails? Well, can't say much about it, but there was some PII. The users had to say where they were located, so their address, other PII information, as well as other not as much information. But in the end, it still had PII. And this lasted about a month until they fixed it. I was getting roughly four or five emails per day for roughly a month, so I thought it was pretty funny considering the target. But if I tell you, you'd probably laugh as well. So yeah, it was a funny bug. So bug number four. This was probably the most interesting one. I put it in the WTF section because I wasn't expecting it at all. So it was an application where we could deploy WordPress applications in an automated way. It provided an API and along with many tools such as phpMyAdmin to, I guess, manage your WordPress instance. So I was doing my regular hunting on it. One thing that I often do is add a service type injection payload, so like double curly brackets, seven times seven, in my email address because I've had luck with that in the past. So I did that for this application as well. So JROC plus, and then my payload, and then, yeah. So one day while looking at the tables in phpMyAdmin, I did see that my SSH API payload did render to 49. That means that something was going on in the backend where it was evaluating the template. Can you guys see it correctly? Yeah, the sun is in front, right? Anyway, so it does show 49. It didn't evaluate properly. So I did have a server-side template injection. I played with it for a long time to try to figure out what engine was actually used. And after a while I was like, man, I have no clue what's going on. I know it's not phpMyAdmin, so I looked at the code and all that stuff and that wasn't it. It's something else. So I ended up asking the program what was going on. I submitted a report to them and I knew they would reply with something because we had a relationship with them, and ended up telling me that. So in the API that powers their application, obviously talks with WordPress and built on PHP, as we all know, and then it passed data in a Python serverless API. I figured Python has Jinja, which is a template engine, but in this case, it doesn't make sense because it's a serverless API. It has to be something else. And then it passed data to Ansible. So I knew what Ansible was, but never actually played with it. I knew what it was for, and I was like, hmm, that's probably interesting. Let me look if there's expressions, something like that, or templates inside of Ansible. So I did a bit of research and stumbled on the Ansible playbooks. So if we look at the docs itself, all good, it actually uses Jinja, which makes sense because my double-created brackets is the same syntax as Jinja, right? So there's something here, right? So I just looked a bit at the documentation and saw that there were variables. So what I did next... So I found the playbook underscore dir reserve variable, or as I called it, a magic variable. So this is pretty much just a directory of where the playbooks are stored. So I put that in my email address and as you guys can maybe not see, or yeah, you guys can see well, cool. It worked. So I knew that it was Ansible, so I confirmed it was Ansible, right? Since I was able to extract the data from the variable. But what can we do with it? So I ended up playing a bit with it. I found a way to extract all environment variables. As I mentioned in the report, I used like the expandVars function to extract the data in the shell environment variable. Same thing for the user and it worked. And then they replied with, thank you. I think this is enough to show that it's pretty bad. You could probably extract secrets from an Ansible environment. But if you look at the time here, it's like 12.45. Roughly three hours later, they decreased it to P2. I was like, shit, what can I do now? So it's Ansible. I can probably get an RCE here, right? But since I didn't know what Ansible, I mean, since I had never played with it before, I didn't know how. Especially since my injection is through like a template injection, which is probably not the same way as like declaring actual Ansible code. So what do we know so far? The email address needs to be RcE compliant when registering. So when you create your account on the app, it'll like send an email to verify that, you know, like as a regular application would do to verify that you own the email address. And Inti, which I'm not sure if it's here or not, did a talk at the ActivityCon in 2020 called You've Got Pwned Exploding Email Systems, which is a really great talk if you guys want to listen to it. We saw YouTube and really enjoyed it. So I kind of, since then, I've been putting like payloads in my email and it's surprising how many times it works. But when we changed our email address, like when we went to our profile and changed our email, nothing happened. No emails were sent to verify. You could just put in like any characters. It wasn't really checking whether it was RFC complied or not, but there were limitations. I could put in a parenthesis and a comma. So these are the only limited characters. Why? I don't know, but it is what it was. So next step, by looking at the docs, I stumbled on the Lookup plugin. And there's one in particular called Pipe or a part of the Lookup plugin, which is built in. And it's pretty much what we want. It reads output from a command and it's installed by default in all Ansible installations. So here's an example of what it will look like within an Ansible YAML file. We can see like they're using Pipe with the command date and yeah, another example in the bottom. So can we do that on the application? So first I tested it locally. Here's what it looked like. I should have put the font bigger. Sorry, guys. So it worked. So I was able to run the ID command, at least locally, right? And with like a regular payload, which contained the Lookup, Lookup and Pipe and then the command that I wanted to run. But in my original payload, I had parenthesis and a comma, which are kind of required in the payload itself, right? But Jinja is Python, it's Python based. So we can use like backslash and X and then like the hex character, which worked. So I'll just show an example of extracting its password file just for my, you know, just to make sure that it actually worked. And then I ran the pipe command. And by the way, that email, I don't own it. It was just like to show that it was possible. So if you want to send emails to jrockatgmail.com, go for it. So we saw that it works. So with this payload, it respected their limitations of not having parenthesis or commas. It is not a Darcy compliant email, but since they weren't verifying that after a change, it was valid for that specific case. So I ran that on that application, looked at the table in phpMyAdmin and I could see that it was running as root. So that was a pretty wild bug, I'd say. I put in a WTF because like I was expecting to inject Ansible in application like ever. So next up, the LOL section. So what was I looking at? A fantasy sports application. People could create private fantasy leagues. The admin set up a password and they would invite their friends to join. The WAF did a self termination. So you can inspect the body of the post requests. And it was really serious on blocking XSS payloads, strip the whole payload itself. So putting like TE and then like straight through tag ST would result in TE and like a regular payload with nothing, it returned nothing. So what did the password contain this character? What would happen? Well, what if users use a password that says, I love dogs? The password would become I, which is kind of funny and easy to boot for us, right? And randomly generated passwords such as this, the password would become T. Or worse, if the password started with that character, there wouldn't be any passwords at all. And the admin wouldn't even know it because she submitted the password and he doesn't know that the password that she has is not right. So invites were sent with a password and clear text in the email. And if the password was empty, considering the password started with that character, there was no passwords for the private leak. And there weren't any passwords in the email itself. So stats and results on this bug. I could join a bit over a thousand leagues by simply reinforcing the first two characters of the password. That was pretty funny. 56 leagues ended up not having a single password. I could have won the prize money in the leagues and, you know, have some fun. Our last bug here, I'm gonna do it really fast, and it's a pretty small bug. Self-serve password reset application. It was a new product built in 2019. A product built on Perl. Yes, you read that or heard that right, Perl. Why? I don't know. So two screenshots required. The first one you can see, I put the ID command in backticks and in the response, we could see the output. So yeah, that was a really LOL bug. So thank you.