Remote Debugging Protocol Privesc Pt 1
A browser's remote debugging agent was exposed with high privileges, allowing an attacker to create a page pointing to a local file and export its contents as a PDF. This enabled arbitrary file reading, such as of SSH private keys.
Published on infosecwriteups.com
In this article, I want to showcase how Remote Debugging Protocol features can be used for local privilege escalation via arbitrary file reading without relying on the GUI. I’ll demonstrate how this can be done using Firefox as an example, but the same steps can also be applied to Chromium-based browsers, as Mozilla…
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the remote debugging agent was exposed without authentication and running with high privileges, allowing arbitrary file access via the debugging protocol.
What the attacker needed
Remote debugging agent running; agent has high privileges; attacker can reach the debugging port
How it was found
- Confirm the remote agent is running and identify the remote debugging port.
- Forward the port and retrieve the webSocketDebuggerUrl.
- Establish a WebSocket connection to the remote agent.
- Create a new page pointing to the target file using Target.createTarget.
- Use the returned targetID with Page.printToPDF to export the file content as a PDF.
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 write-up has not been written yet. The Original tab links to the source.
Browsers can be controlled remotely for debugging, and if that remote control is left open and running with high permissions, anyone who can reach it can tell the browser to open local files. The attacker then uses a built-in feature to turn the file into a PDF and download it, reading files they should not see.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.