Webkit WebSocket code execution vulnerability
A use-after-free vulnerability in WebKitGTK's WebSocket handling during document reloads allows a malicious web page to trigger memory corruption, potentially leading to remote code execution. An attacker can get a user to visit a crafted webpage to exploit this.
Originally disclosed on Cisco Talos
A code execution vulnerability exists in the WebSocket functionality of Webkit WebKitGTK 2.30.0. A specially crafted web page can trigger a use-after-free vulnerability which can lead to remote code execution.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the WebSocket object is freed when its frame is detached during a document reload, but a subsequent call to close() still accesses the freed object.
Impact
Proper heap grooming could give an attacker full control of this use-after-free vulnerability and as a result could allow it to be turned into arbitrary code execution.
What the attacker needed
Victim visits a malicious webpage; WebKitGTK 2.30.0
The fix
The vendor patched the vulnerability, but the text does not describe the fix.
How it was found
- Unpack the provided proof-of-concept archive into a directory served by a local web server.
- Build WebKit with AddressSanitizer and release flags.
- Using the Minibrowser, navigate to the index_new.html page.
- Observe the AddressSanitizer log in the console.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
This is a memory safety bug in a web browser engine. When a web page uses a WebSocket (a two-way communication channel) and then the page is reloaded or a frame is removed, the browser frees the WebSocket object but later tries to use it again. This 'use-after-free' can let an attacker control the freed memory and potentially run their own code on the victim's computer.
What is Memory corruption?
Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.