Bypassing Chrome's URL restrictions
Chrome's defence against HTML data exfiltration via URLs only blocked http and https schemes, so an attacker could use an FTP URL in a dangling markup injection to send stolen page content to an attacker-controlled server. The bypass allowed exfiltration of sensitive data such as CSRF tokens.
Published on bencteux.fr
Studying about Content Security Policy (CSP) features, I came across a nice bypass of Chrome’s URL restrictions that the browser implements to prevent leak of HTML data. However, Chrome dropped the feature on which with the bypass rely on in its 89 version released stable a few days ago so it is no longer possible to…
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 URL restriction was only enforced for http and https schemes, leaving other supported schemes like FTP and Gopher unchecked.
Impact
An attacker could exfiltrate sensitive HTML content, such as CSRF tokens, from a vulnerable page, but the bypass only worked in Chrome versions before 89 and required an HTML injection vulnerability.
What the attacker needed
HTML injection vulnerability; Chrome version before 89; Attacker-controlled FTP server
The fix
Chrome dropped FTP and Gopher support in version 89, which removed the bypass because the underlying feature was killed.
How it was found
- Identify a page vulnerable to HTML injection.
- Inject a dangling meta refresh tag that points to an FTP URL on an attacker-controlled server.
- Host a fake FTP server to receive the connection.
- Load the vulnerable page in Chrome; the browser sends the exfiltrated HTML content in the FTP request.
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.
When a website lets an attacker inject HTML, the attacker can use a trick called dangling markup to make the browser send part of the page to their own server. Chrome tried to stop this by blocking URLs that contain certain characters, but it only checked web addresses starting with http or https. The attacker found that using an FTP address instead let the data through.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.