1 00:00:00,000 --> 00:00:13,560 So it is my pleasure to welcome Ian Hickey to the stage talking about relative path file injection, the next evolution in relative path. 2 00:00:14,000 --> 00:00:15,520 Okay. 3 00:00:16,500 --> 00:00:18,260 Let's give it up. 4 00:00:24,860 --> 00:00:29,480 Thank you for having me today at the AppSec Village, DEF CON 32. 5 00:00:29,480 --> 00:00:33,400 Thank you for having AppSec Village here as well. 6 00:00:34,600 --> 00:00:36,500 I'm a software developer. 7 00:00:36,660 --> 00:00:38,460 I don't work in security. 8 00:00:38,460 --> 00:00:40,060 I work in ed tech. 9 00:00:40,340 --> 00:00:46,100 But every once in a while I like to spend some brain power looking at some security things. 10 00:00:46,100 --> 00:00:56,900 And the last time I was doing this in April or May, I had a couple of discoveries that I thought were interesting and I'm going to share them with you today. 11 00:00:58,240 --> 00:01:03,480 So many of you know that there's relative path overwrite. 12 00:01:09,360 --> 00:01:43,780 Relative path overwrite is a way to if you can inject CSS onto an HTML page and if a website is vulnerable to path confusion, then you can actually get the default link tag in HTML to interpret the current HTML page as a CSS style sheet and under some circumstances it will execute the CSS. 13 00:01:44,420 --> 00:01:53,240 And older Internet Explorer used to be able to use things like an expression tag and execute JavaScript from CSS. 14 00:01:53,260 --> 00:02:01,060 So it was a pretty ‑‑ it was a pretty interesting way to get JavaScript execution. 15 00:02:01,760 --> 00:02:17,960 So what I've been looking at is port swagger research has these impossible labs and one of these impossible labs I've been looking at for a couple of years and I'll go back and play with different things and see if I can make any progress on it. 16 00:02:18,640 --> 00:02:25,900 In this case it was ‑‑ there's context in HTML where you can't execute JavaScript. 17 00:02:25,900 --> 00:02:27,400 The browser won't let you. 18 00:02:27,460 --> 00:02:33,360 And some of those places are no script within a frame set tag. 19 00:02:33,360 --> 00:02:42,520 It interprets ‑‑ it interprets any HTML that you can inject as just plain text. 20 00:02:44,300 --> 00:02:47,160 And because it's plain text you can't do anything with it. 21 00:02:48,060 --> 00:02:54,660 So the first insight that I had into this was ‑‑ see here's an example. 22 00:02:55,600 --> 00:02:57,220 You have a B tag but it's just text. 23 00:02:57,220 --> 00:02:59,060 You can't display anything. 24 00:02:59,220 --> 00:03:19,960 The first interesting sort of insights I had into this was actually you can execute JavaScript, but you would have to have AngularJS installed and you would have to be using AngularJS and it's been end of life for quite some time. 25 00:03:20,800 --> 00:03:23,000 But there is a way to do it. 26 00:03:23,000 --> 00:03:39,280 So if you have a no frames tag inside of a frame set tag and there happens to be AngularJS on the page, then you can just instantiate AngularJS and execute some JavaScript. 27 00:03:39,280 --> 00:03:40,660 That's cool. 28 00:03:41,260 --> 00:04:06,120 In the original relative path overwrite, if you needed to inject CSS into the page, and again, it didn't matter where you did it, because in both cases, those parsers are not taking into consideration the rules that the browser follows. 29 00:04:06,120 --> 00:04:19,980 Angular will happily execute JavaScript anywhere on the page it finds it and in this case, when it's interpreting a HTML page as a style sheet, it doesn't care where it finds CSS, it will just execute it. 30 00:04:20,580 --> 00:04:30,420 So that was a starting point and then the epiphany was sort of, okay, well, you can use other parsers to execute JavaScript within these contexts where you're not supposed to be able to do it. 31 00:04:30,420 --> 00:04:34,620 So what other parsers are there that will do the same thing? 32 00:04:35,140 --> 00:04:47,500 One thing to note about both of these things is that they're lenient parsers, meaning it does not matter that there's HTML surrounding the thing that they're looking for. 33 00:04:47,560 --> 00:04:51,260 All that it matters is that it eventually finds it. 34 00:04:51,260 --> 00:04:52,460 So that was my starting point. 35 00:04:52,460 --> 00:04:53,240 What else is there? 36 00:04:53,240 --> 00:04:58,760 So I started making a list of all the different types of parsers there are. 37 00:04:58,760 --> 00:05:14,500 There's SVG parsers and XML and PDF and rich text and markdown and after spending more time than I would care to admit with markdown parsers, I started thinking about PDF a lot. 38 00:05:14,820 --> 00:05:17,880 PDF can actually be handwritten. 39 00:05:17,880 --> 00:05:32,620 A lot of people think of it as a binary format and there might be binary mixed in with it, but you can actually just write a PDF file and as plain text. 40 00:05:32,620 --> 00:05:46,400 So if you have plain text injection like we're talking about here in one of these contexts such as no script, no frames, then you can inject PDF. 41 00:05:46,460 --> 00:05:48,560 Well, PDF can execute JavaScript. 42 00:05:48,560 --> 00:05:51,060 PDF can submit forms. 43 00:05:51,060 --> 00:05:55,520 PDF can ‑‑ there's tons of research into malicious PDFs. 44 00:05:56,340 --> 00:06:14,760 So I started playing with it and the second big epiphany that I had that just really surprised the shit out of me is that PDFs are also super lenient because PDFs start with these magic characters and end with magic characters. 45 00:06:14,760 --> 00:06:17,660 It doesn't really care what it finds before and after that. 46 00:06:17,660 --> 00:06:30,400 So you can actually take this HTML document with PDF persistently injected into it and you can save this as a PDF and it will actually execute. 47 00:06:30,680 --> 00:06:33,360 And this is what this is here. 48 00:06:33,360 --> 00:06:41,460 This is just an embedded HTML file renamed as PDF and it displays as a PDF and it executes JavaScript. 49 00:06:43,600 --> 00:06:53,900 How many people, how are you going to convince people to download an HTML file as a PDF? 50 00:06:54,000 --> 00:07:00,080 Like are you going to put something on the page that says right click here, save it as whatever? 51 00:07:00,080 --> 00:07:01,620 They just won't do it. 52 00:07:01,760 --> 00:07:14,460 So I started thinking about ways to get people to download these PDFs without me having to explicitly convince them of anything. 53 00:07:15,100 --> 00:07:28,320 And when I started thinking about the original relative path overwrite, which interprets the current page as a CSS style sheet, well the reason why it does that is because the browsers are stupid. 54 00:07:28,320 --> 00:07:31,740 They just, whatever you return back from the server it's going to use. 55 00:07:31,740 --> 00:07:47,520 And if you happen to be using a server that when you add a forward slash at the ends returns the current page back, well if the current page happens to have PDF injected into it then that's what you're going to get. 56 00:07:50,340 --> 00:07:52,520 So that's exactly what I did. 57 00:07:52,520 --> 00:08:09,680 I'm going to show you how it works now and before we even get into it, just so everyone sees because it's easier to simply see what's happening than to explain it. 58 00:08:09,860 --> 00:08:13,440 Someone goes to a website. 59 00:08:13,520 --> 00:08:21,480 There is a download link on the website and the download link happens to use a relative path. 60 00:08:21,920 --> 00:08:30,100 Well if you click this download link all that's going to happen is it's going to download whatever the file was that you intended to download. 61 00:08:30,600 --> 00:08:40,160 And if we open this up, all this is, is, oop, and if we open this up, 62 00:08:43,830 --> 00:08:51,550 all this is, is, you know, oh sorry, sorry. 63 00:08:52,430 --> 00:08:54,930 Let's see if I can make that bigger for you. 64 00:08:55,910 --> 00:08:58,250 Oop, oop, 65 00:09:04,530 --> 00:09:06,510 one second. 66 00:09:06,510 --> 00:09:08,670 Okay, good PDF download. 67 00:09:08,670 --> 00:09:13,190 So I've downloaded this PDF and I open this PDF. 68 00:09:13,190 --> 00:09:17,030 I'm going to open it with Google Chrome. 69 00:09:17,030 --> 00:09:19,250 It's just a normal harmless PDF. 70 00:09:19,310 --> 00:09:20,850 No big deal. 71 00:09:20,850 --> 00:09:29,830 However, all you have to do is add a forward slash at the end and you notice it lost its styling. 72 00:09:29,830 --> 00:09:33,410 The reason it lost its styling is because now the browser is confused. 73 00:09:33,650 --> 00:09:47,750 If you look in the, if you look at what it's actually trying to include as the style sheet, what you find now is it's actually getting the current page. 74 00:09:47,850 --> 00:09:50,010 That's relative path over it. 75 00:09:50,050 --> 00:09:53,190 It's confused so it's returning this back. 76 00:09:53,210 --> 00:10:02,750 The effect of that, once it loses its styling, is that if you now click this, it's actually going to return the current page as the PDF. 77 00:10:03,970 --> 00:10:12,490 Which means when someone opens this, it's not going to be the same PDF that, that they expected to open. 78 00:10:12,490 --> 00:10:14,850 Instead, 79 00:10:18,520 --> 00:10:20,400 it's going to execute JavaScript. 80 00:10:21,140 --> 00:10:23,620 So what just happened? 81 00:10:23,620 --> 00:10:26,520 Where did, where did the new PDF come from? 82 00:10:26,520 --> 00:10:28,580 Well, the PDF lives on the server. 83 00:10:28,760 --> 00:10:40,440 Because the HTML lives on the server and you've persistently saved PDF content into that HTML page, right? 84 00:10:40,440 --> 00:10:50,880 And it's sufficiently confused so when they go to download, it downloads what you want them to download instead of whatever they were trying to download. 85 00:10:50,880 --> 00:10:51,920 I mean, this is dangerous. 86 00:10:51,920 --> 00:10:58,920 If you think about it, what if this was a, what if this was a text PDF site or something? 87 00:10:59,180 --> 00:11:02,060 It's not going to be just one link that this happens with. 88 00:11:02,060 --> 00:11:05,100 There will be every link on the page that uses a relative download. 89 00:11:05,100 --> 00:11:09,920 As soon as they click it, it's going to download whatever that PDF is. 90 00:11:10,540 --> 00:11:13,820 So the things that you can do with PDF are pretty interesting, right? 91 00:11:13,980 --> 00:11:20,360 Depending on the PDF reader that the user happens to be using. 92 00:11:20,860 --> 00:11:33,240 So you have, you have something like Fox Pro, I think it's called, that allows you to do commands when the PDF opens, right? 93 00:11:33,240 --> 00:11:34,820 You can execute shell commands. 94 00:11:34,820 --> 00:11:47,200 So there's nothing stopping you to simply populate your PDF with a launch command that executes shell commands as long as the user has permission to be doing it to do whatever you want, right? 95 00:11:47,200 --> 00:11:54,220 You can run scripts, you can download new scripts, you can, you know, whatever. 96 00:11:54,340 --> 00:12:05,480 In fact, if you want to stay in the web context, I imagine you could probably open a Chrome browser headless with the user's data set as their data and then just go explore the Internet as them, right? 97 00:12:05,480 --> 00:12:07,520 Because why couldn't you? 98 00:12:07,660 --> 00:12:10,400 So it's pretty dangerous. 99 00:12:10,400 --> 00:12:30,060 But thinking this through a little bit more, it's interesting that you can do it with PDF and all I did here was this would be, you know, say it's a profile page and you have some public, you know, blurb about yourself that you've put this PDF in. 100 00:12:30,060 --> 00:12:36,660 However you get the persistent content injection onto the page. 101 00:12:36,660 --> 00:12:46,440 But as long as it's there in some capacity and as long as you can save it as a PDF, which we can because there's a simple download link, then it'll execute. 102 00:12:46,580 --> 00:12:57,120 So in the original relative path overwrite, what you needed was a link tag with a relative path to the style sheet. 103 00:12:57,120 --> 00:13:05,460 In this case, you need an anchor tag with a relative path to the PDF. 104 00:13:05,760 --> 00:13:09,560 And if it's not HTML, the download has to be fully qualified. 105 00:13:09,560 --> 00:13:18,000 Meaning if you don't have sample PDF here as download, then it won't accept downloading the HTML as a PDF. 106 00:13:18,360 --> 00:13:21,940 The content disposition will be wrong. 107 00:13:22,120 --> 00:13:26,800 So that's the basic requirement for executing this. 108 00:13:26,800 --> 00:13:27,760 It has to be a page. 109 00:13:27,760 --> 00:13:38,740 So think like a, you know, PDF library or, you know, places where you can inject content and then it says, save your whole history or something like that. 110 00:13:41,220 --> 00:13:50,460 But this technique is going to be more useful the more file types that we find that you can do this with, right? 111 00:13:50,460 --> 00:14:00,620 So PDF is great if they happen to be using a PDF viewer that supports executing shell commands, et cetera. 112 00:14:01,720 --> 00:14:07,140 But there has to be other lenient parsers and lenient file types that you can use to do similar things. 113 00:14:07,140 --> 00:14:10,740 So then I started exploring that. 114 00:14:18,940 --> 00:14:26,540 So Gareth Hayes, I was talking to him about this just to make sure that he hadn't heard of it being discovered before either. 115 00:14:26,780 --> 00:14:34,600 He suggested I talk to a gentleman by the name of Orange Albertini who specializes in polyglot file types. 116 00:14:34,760 --> 00:14:36,200 He's a maven. 117 00:14:36,200 --> 00:14:44,240 He's the type of guy that his business card, you can put it into a Super Nintendo emulator. 118 00:14:44,600 --> 00:14:47,840 And even though it's a PDF, it will still play in the emulator. 119 00:14:47,840 --> 00:14:49,000 It's crazy. 120 00:14:49,180 --> 00:14:56,640 And we were brainstorming other types of lenient file types where this sort of thing might work with. 121 00:14:56,940 --> 00:15:00,480 And we went, you know, zip file types to tar. 122 00:15:00,540 --> 00:15:03,460 Tar is another like plain text one that you can sort of hand write. 123 00:15:03,460 --> 00:15:06,260 And it took me down this road looking at that. 124 00:15:06,260 --> 00:15:09,940 And while I was exploring it, I was thinking about, well, what would you put in a shell scripts? 125 00:15:09,940 --> 00:15:18,800 And then anyone who's dealt with enough shell scripts knows that shell scripts can actually be really lenient when they're run too. 126 00:15:18,920 --> 00:15:46,080 So what this means is if you happen to be what the user is trying to download is a shell script and you have some sort of content injection, you can actually get them to get them to download a shell script you know, whatever, PowerShell file or a batch file or, 127 00:15:46,080 --> 00:15:49,200 you know, batch scripts. 128 00:15:49,200 --> 00:16:10,840 And in some Linux distributions, and I'm looking at especially Windows WSL2 with U12, et cetera, with some of these things, it'll actually happily execute an HTML file as a shell script. 129 00:16:10,840 --> 00:16:16,340 And it will error on every single line until it gets to something that it understands and then it will execute it. 130 00:16:16,340 --> 00:16:29,860 But if someone's going to a site looking to download a shell script, it's going to say, hey, download this code and then run it as a super user, right, because that's what they always say. 131 00:16:30,000 --> 00:16:47,460 So if they do that, and the link that they clicked happens to have a forward slash at the end, it's susceptible to, you know, path confusion, et cetera, then the script that they get is an HTML page, and when they run it, it's going to run. 132 00:16:47,800 --> 00:17:00,000 And what that looks like is... what that looks like is... 133 00:17:00,020 --> 00:17:14,680 something like this, where every single line, HTML, the head, all of it, errors, line by line by line, and then it gets to echo hello world, and it executes it, and then it exits, and that's it. 134 00:17:14,680 --> 00:17:17,800 By the time they realize something happened, it's going to be too late, right? 135 00:17:19,180 --> 00:17:22,660 So I managed to get this working with WSL2. 136 00:17:23,460 --> 00:17:28,780 I managed to get it working with PowerShell, which does the exact same thing, right? 137 00:17:28,780 --> 00:17:40,420 It'll execute every single line of the HTML file, because it's a PS1 file or whatever, and then it gets to hello world, it executes it, and then it continues, you know, just executing nonsense. 138 00:17:40,420 --> 00:17:56,060 The closest I could get it with regular Linux shells is... you have to be able to inject something right after HTML, so it's far-fetched, but I threw it in there in case anyone has any ideas on how to get that working. 139 00:17:56,580 --> 00:18:19,680 I did actually get this similar thing working on OSX and Linux, if a user's using, you know, BoxPro or whatever it is, because you can have a launch command that simply reads whatever it is in its own file, and then, you know, executes it line by line. 140 00:18:19,680 --> 00:18:22,160 So it can be done. 141 00:18:22,160 --> 00:18:23,220 It can be done. 142 00:18:24,140 --> 00:18:30,220 And so that's... so now we have two, three, four types of files. 143 00:18:30,740 --> 00:18:33,540 Ideally, we would have dozens, hundreds. 144 00:18:33,540 --> 00:18:38,020 There's so many file types out there to get this type of stuff working well. 145 00:18:39,560 --> 00:18:44,640 So I kept on... I kept on investigating other things. 146 00:18:44,820 --> 00:18:47,600 What does not mind there being HTML, right? 147 00:18:47,600 --> 00:18:54,300 What will someone simply download from the Internet and then throw into something and have it execute, right? 148 00:18:54,340 --> 00:19:03,200 So pretty much all server-side... server-side templating languages are like this, right? 149 00:19:03,200 --> 00:19:24,380 So if someone's looking for, you know, a Ruby or whatever, a ColdFusion script or anything else, you know, they're probably going to grab it and then just throw it into whatever it is to test it, at which point it's already executed anything it needs to execute, 150 00:19:24,380 --> 00:19:24,660 right? 151 00:19:24,660 --> 00:19:31,580 And the cool thing there is that any of the server-side languages, they don't... they're expecting there to be HTML, right? 152 00:19:31,580 --> 00:19:36,700 They're expecting there to be all this other stuff in there, so they won't complain. 153 00:19:37,620 --> 00:19:42,440 And so these are the ones that I found that it would work with out-of-box, right? 154 00:19:42,440 --> 00:19:44,620 So you have this PHP. 155 00:19:45,480 --> 00:19:52,260 Similar thing right here, if we look at this vulnerable PHP. 156 00:19:53,280 --> 00:20:16,280 So all this is going to do, if we go here, is the safe download... let's go to the PHP file, open it up, show you what this has generated. 157 00:20:18,400 --> 00:20:24,500 And what this did is because it's server-side, it already executed this, and it says welcome user, no big deal. 158 00:20:25,560 --> 00:20:34,700 We do it the other way, forward slash, all of a sudden they download it. 159 00:20:42,080 --> 00:20:44,940 This time, welcome bad guy, right? 160 00:20:44,940 --> 00:20:55,620 So there's nothing stopping you, it doesn't have to be bad guy, it could be read the contents of a password file, whatever, send it somewhere, anything you want it to. 161 00:20:55,620 --> 00:21:09,540 If you can get people... the thing that's sort of insidious about this, even though there's like user interaction that could take place, is that the user's going to a server that's trusted, right? 162 00:21:09,540 --> 00:21:16,800 There's nothing untrusted about this server, they've been to it a thousand times, and they're clicking a download link. 163 00:21:16,940 --> 00:21:22,320 There's no difference if you were able to just break into the server and replace the file, right? 164 00:21:22,320 --> 00:21:24,440 Because the effect's the same. 165 00:21:27,340 --> 00:21:39,180 But what would be really interesting is if you didn't have to do this whole download portion of it at all, right? 166 00:21:39,180 --> 00:21:43,640 And that's the hardest part, is how do you get someone to... 167 00:21:43,640 --> 00:21:52,100 you know, if someone's going to go download a PDF, click on a link and download a PDF, there's a high chance that they're going to go look at the PDF, right? 168 00:21:52,100 --> 00:21:56,560 I mean, that's what it's intended for, they're going to trust that whatever's in there. 169 00:21:56,560 --> 00:22:01,580 It should be, you make a PDF that looks like a tax document and submits back to your server, whatever. 170 00:22:02,900 --> 00:22:07,740 But it would be great if they didn't have to download the thing in the first place. 171 00:22:07,740 --> 00:22:10,500 So I started thinking about how that could possibly work. 172 00:22:11,080 --> 00:22:13,560 And that's pretty tricky, right? 173 00:22:15,030 --> 00:22:24,720 But there's been a rise in all of these HTML over the wire sort of frameworks. 174 00:22:24,720 --> 00:22:28,140 There's Livewire, there's Hotwire, there's HTMX. 175 00:22:28,140 --> 00:22:40,340 And all of these things, what they're doing is they're getting HTML from the server instead of putting all the HTML client side, right? 176 00:22:40,340 --> 00:22:51,760 And the HTML they get from the server could be, you know, pre-rendered with, like, the user's profile picture and, you know, username or something like that. 177 00:22:52,240 --> 00:23:03,560 But they're going to suffer the same type of issue if they happen to be on a server that returns the current page when there's forward slash at the end. 178 00:23:03,660 --> 00:23:09,820 So something like that, what it would look like is... 179 00:23:16,180 --> 00:23:18,280 so I'm not using any of the frameworks. 180 00:23:18,280 --> 00:23:20,280 This is just straight jQuery. 181 00:23:22,020 --> 00:23:42,100 But what this does is when the page loads, it attempts to get some DOM element and then inject it into this main div, right? 182 00:23:42,360 --> 00:23:44,600 And again, it's the same thing. 183 00:23:44,600 --> 00:23:51,100 All we're doing is, you know, doing a... you don't need to do this. 184 00:23:52,280 --> 00:23:57,260 All it's doing is just, you know, using jQuery HTML, just setting the HTML. 185 00:23:57,260 --> 00:23:58,340 No big deal. 186 00:23:58,340 --> 00:24:01,920 And if we go look at what this script does... 187 00:24:07,040 --> 00:24:08,600 what's that? 188 00:24:08,960 --> 00:24:10,800 There's nothing on this page. 189 00:24:10,800 --> 00:24:13,520 There's literally nothing on this page. 190 00:24:15,280 --> 00:24:18,980 So all this does is it doesn't do anything initially. 191 00:24:20,080 --> 00:24:27,560 You can see when it goes to get the... let me see if I can make this bigger. 192 00:24:29,400 --> 00:24:30,680 Excuse me? 193 00:24:31,720 --> 00:24:33,400 Oh, got you, got you. 194 00:24:33,580 --> 00:24:37,720 So nothing too interesting is happening on this page yet. 195 00:24:37,720 --> 00:24:38,900 It gets jQuery. 196 00:24:39,180 --> 00:24:43,340 It reaches out and it gets this thing that says welcome user. 197 00:24:43,340 --> 00:24:44,120 No big deal. 198 00:24:44,120 --> 00:24:46,820 And then it tries to inject the welcome user into the page. 199 00:24:46,960 --> 00:24:57,540 But you add a forward slash on to the end and now it actually gets the current page, vulnerable HTML. 200 00:25:04,500 --> 00:25:07,200 And... oh, one second. 201 00:25:07,720 --> 00:25:09,380 Let's see what just happened. 202 00:25:11,850 --> 00:25:13,230 What did I do? 203 00:25:14,450 --> 00:25:15,970 Oh, there it goes. 204 00:25:15,970 --> 00:25:29,270 So in this case what just happened is when it reached out to get it, the ID that it found was for a frame set. 205 00:25:29,430 --> 00:25:44,630 And HTML is probably the most lenient parser of all because it has this really weird behavior where if you try to inject HTML tags into other HTML tags that it doesn't like, it will simply strip those tags away. 206 00:25:44,630 --> 00:25:53,930 And that's exactly what happened here is because when it found... oops. 207 00:26:00,000 --> 00:26:01,640 It's not letting me leave. 208 00:26:01,800 --> 00:26:02,820 It's not letting me leave. 209 00:26:02,820 --> 00:26:03,300 Okay. 210 00:26:03,740 --> 00:26:04,460 Oops. 211 00:26:05,260 --> 00:26:17,620 Yeah, so when it found the... this frame set, it... when it injected it into this main tag, it actually stripped the frame set away. 212 00:26:17,620 --> 00:26:28,500 So even though the browser is saying hey, this frame set is completely innocuous, we're just going to treat it like text, the framework itself can take that and inject it automatically. 213 00:26:28,660 --> 00:26:38,100 So there's places where maybe you weren't concerned about people getting content injection before, but now you have to be worried about it. 214 00:26:38,100 --> 00:26:39,860 And how do you mitigate something like this? 215 00:26:39,860 --> 00:26:43,580 Well, there's all the standard ways to mitigate it. 216 00:26:43,580 --> 00:26:49,960 Like one, you have to stop using... either use a base tag so that things aren't relative. 217 00:26:49,960 --> 00:26:52,460 They have a... things aren't relative. 218 00:26:52,900 --> 00:26:57,820 You can make them root relative by adding a forward slash at the beginning, right? 219 00:26:59,260 --> 00:27:03,620 Content security policy, all these things, you have to do something. 220 00:27:03,620 --> 00:27:12,960 But also educating people, you can't actually trust a file download if it's using a relative... if it's using a relative path. 221 00:27:13,560 --> 00:27:19,320 So basic mitigations in place. 222 00:27:22,720 --> 00:27:24,240 Yeah. 223 00:27:25,940 --> 00:27:32,000 All the... all the basic mitigations, so path handling, you can't... 224 00:27:32,000 --> 00:27:39,580 you can't it's important to check if the server that you use... you're using is vulnerable to this type of path handling. 225 00:27:39,580 --> 00:27:47,880 If you add a forward slash at the end of the URL and it loses all of its styling, it's a pretty good indication that it has this issue. 226 00:27:47,880 --> 00:27:51,200 Default PHP server has this issue. 227 00:27:51,740 --> 00:27:53,520 I did make a GitHub for this. 228 00:27:53,520 --> 00:27:59,520 If anyone wants to play with it themselves, you can find it on GitHub. 229 00:28:03,210 --> 00:28:04,050 Yeah. 230 00:28:04,050 --> 00:28:11,030 So this is a novel file injection vector. 231 00:28:12,470 --> 00:28:24,010 I figured out a number of server side scripts, shell scripts, PDFs, but there has to be... there has to be dozens more if, you know, people want to explore it. 232 00:28:24,330 --> 00:28:28,130 I rarely do bug bounties because I don't work in security. 233 00:28:28,130 --> 00:28:31,830 So I do do it sometimes, but it feels like a job to me. 234 00:28:32,290 --> 00:28:34,890 So I try not to. 235 00:28:34,890 --> 00:28:42,630 I would imagine there's a number of these vulnerabilities that you can go and find if you're so inclined. 236 00:28:42,630 --> 00:28:44,830 No one's ever looked for them before. 237 00:28:47,110 --> 00:28:57,070 So yeah, I think... I think that there's a lot more that can be done there with the shell scripts on Linux to figure out how to get them to execute. 238 00:28:58,490 --> 00:29:00,210 And yeah. 239 00:29:00,250 --> 00:29:04,470 I think if any of you do bug bounties, you should go out and try to find it. 240 00:29:04,870 --> 00:29:06,070 And that is my talk.