3 ms·
I think disagree with every single point you brought up, having seeing exploits that involve all of them.
by saagarjha 3y ago
I think disagree with every single point you brought up, having seeing exploits that involve all of them.
- Dylan16807 3y agoIf you've seen an exploit caused by a big pre-allocated array of untrusted RGBA data, please explain how. (If you mean they put evil data through it and then used a separate exploit to run it, that's not a vulnerability, that's just "data transfer exists".) And you seeing someone screw up an IOMMU doesn't disqualify it from being one of the easiest parts of a hardware decoder.
- saagarjha 3y agoCode to calculate size of preallocated array is incorrect. Size ends up too small or underflows. Buffer is reused across calls. Buffer is actually mapped across processes and thus page-aligned. Code to check how much space is needed checks number of pages versus actual number of bytes, and fails to clear leftover data correctly. Code receives RGBA buffer but expects some other encoding. Accidentally reads out of bounds as a result. You can definitely say “oh these are stupid and I wouldn’t screw this up” but people do and that’s what really matters.
- Dylan16807 3y ago> Code to calculate size of preallocated array is incorrect. Size ends up too small or underflows. If you go outside the array you copied/mapped out of the sandbox, then that doesn't let the attacker code escape the sandbox, you just put some of your own data onto the screen. If you mean the sandbox isn't given enough memory, then that will make the sandbox exit when it hits unmapped addresses. And how did you screw up length x width x 4? > Buffer is reused across calls. Buffer is actually mapped across processes and thus page-aligned. Code to check how much space is needed checks number of pages versus actual number of bytes, and fails to clear leftover data correctly. The sandboxed process doesn't have any way to exfiltrate data. At most it can display it back to you, which is not really any worse than innocent code which could also send back the leftover data. > Code receives RGBA buffer but expects some other encoding. Accidentally reads out of bounds as a result. Reads out of bounds and does what with it? That doesn't sound like a vulnerability to me. It might display private data or crash, but that's entirely of its own volition. The behavior would be the same between innocent code in the sandbox and malicious code in the sandbox.
- Hackbraten 3y ago> And how did you screw up length x width x 4? There’s a million ways to screw that up. People botch SCM merges. People are hungover. People are distracted. People are tired. People are heartbroken. People are going through divorces. People have parents dying. People forget numbers. People make copy-paste mistakes. All the time. > The sandboxed process doesn't have any way to exfiltrate data. You can abuse it to gain a (known-page-offset) write primitive in the other, non-sandboxed process to which the buffer is also mapped.
- Dylan16807 3y ago> People make copy-paste mistakes. All the time. But if you do that every image looks wrong and it's vanishingly unlikely to get into a release. > You can abuse it to gain a (known-page-offset) write primitive in the other, non-sandboxed process to which the buffer is also mapped. There's no reason to have the memory mapped into both processes at once, and you can't exploit the bytes you write without a real vulnerability. Since it's a one-shot write into the buffer, if your intent is using it as an exploit step then you might as well encode an actual image with your exploit-assisting bytes.
- Hackbraten 3y ago> But if you do that every image looks wrong and it's vanishingly unlikely to get into a release. The code doesn't have to be wrong for every input. It may be wrong just for pathological cases that don't occur in the field unless specifically crafted. > Since it's a one-shot write into the buffer, if your intent is using it as an exploit step then you might as well encode an actual image with your exploit-assisting bytes. The assumption was that the code tries to clean up the buffer immediately after use.
- Dylan16807 3y ago> The code doesn't have to be wrong for every input. It may be wrong just for pathological cases that don't occur in the field unless specifically crafted. I could argue this more but it doesn't matter, that was just a little tangent, getting the size wrong will not let anything out of the sandbox. > The assumption was that the code tries to clean up the buffer immediately after use. Cleaning up would be removing the mmap. How are you going to exploit that? Your scenario is not very clear. I think you're going for a situation where the sandboxed process can write to data in the host process outside the buffer? In a general sense I can imagine ways for that scenario to occur, but I can't figure out how you could get there via mmapping a buffer badly. A buffer mmap won't overlap anything else. If the mmap is too small then either process could read past the end, but would only see its own data (or a page fault).