Being new to researching vulnerabilities in native applications (as opposed to web apps), I'm having difficulties understanding a crash in Debian's browser, Epiphany (version 2.30.6), and determining if it is exploitable.
I've discovered that the following HTML + CSS code causes a crash in Epiphany, when a redirect to another page happens:
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
::-webkit-scrollbar-thumb {
height:0;
}
::-webkit-scrollbar {
overflow:visible;
}
</style>
<meta http-equiv="Refresh" content="1; http://www.example.com/" />
</head>
<body></body>
</html>
So far, I've been trying to learn about it and determine it's exploitability by using GDB and Valgrind.
GDB, most of the times, reports a Segmentation Fault or at an address which changes every time I run it. I've also seen it reporting SIGILL instead of SIGSEGV, but it's rare. Debugging further, I've discovered that this is being caused by a CALL [edx+0x228] instruction. The value of the edx register on the moment that this instruction is executed changes slightly on each execution, but, according to the memory map, it is always within the heap.
Valgrind reports a Invalid read of size 4, [...] 3 bytes after a block of size 61 free'd, just before a Jump to the invalid address stated on next line and, finally, the Segmentation Fault.
For me, it looks like an use-after-free bug. I'd like someone to confirm that I'm right.
Assuming that this is, in fact, an use-after-free, I know that the bug might be exploitable. However, I've never managed to overwrite the memory at the address which results from the expression edx+0x228, and therefore I cannot control the instruction pointer.
I believe that the reason for this is because the object is being freed just after the page redirect starts, thus I cannot overwrite the space in memory that it was occupying with Javascript that is executed when the page is loaded. I've tried adding a heap spray to window.onunload, however, adding this method (with any kind of code inside) actually prevents the crash from happening.
So, basically, my questions are:
- Is this really an use-after-free bug?
- If it is, how may I determine when the object is being freed, and therefore try to learn if it's possible to overwrite it's location in memory after it is freed?
Any suggestions about determining if code execution is possible with this bug, and how it would happen, is also welcome.
Thanks.