Insufficient policy enforcement in DevTools (CVE-2026-3940)
The DevTools Sources panel re-fetches resources for a page, and when a Service Worker is registered on the target site, this re-fetch is initiated from the current site, causing SameSite=Strict cookies to be sent even for POST requests. An attacker can use a top-level form submission to send a malicious POST request with the victim's cookies, which is normally blocked by SameSite, but after the victim opens DevTools, the request is resent with the cookies included.
Originally disclosed on Chrome VRP
- Fix shipped in 3 months
Steps to reproduce the problem
- Visit https:// jtw.sh/ samesite-post-bypass-ce7139c3/target-sw.php so that cookies are set and a service worker is registered on the target website (
jtw.sh) - Visit the attacker's site: https:// vps.jorianwoltjer.com/ samesite-post-bypass-ce7139c3/csrf-sw.html
- Right click and choose Inspect to open the DevTools, or press
Ctrl+Shift+IorF12on the keyboard - In the background, a malicious POST request with all cookies has now been sent to the target. See it in the Sources tab viewing the
target-sw.phpfile (see recording samesite-post-bypass-sw.mp4)
Source code for reproducing this locally is also provided in the attached samesite-post-bypass-sw.zip. Run with php -S 0.0.0.0:8000
Problem Description
In DevTools, the Sources panel shows source code of the current page and its associated files. It gets these resources from the cache, or re-fetches them if needed. This new request is initiated from the current site, which is a contradiction if the original navigation came from cross-site. It means that the request for the Sources tab will contain SameSite=Strict cookies even for POST requests.
Weirdly, this re-fetching process seems to only happen if there is a Service Worker registered for the target. Otherwise the error "Content unavailable. Resource was not cached" is shown in place of the content. The service worker doesn't have to do anything, it just needs to be registered on the target. So any site that uses a service worker and relies on SameSite for Cross-Site Request Forgery (CSRF) protection is vulnerable.
From the attacker a simple top-level form submission is enough. While it shouldn't work initially, after the DevTools are opened on the resulting page, the request is resent and SameSite=Strict cookies are now sent with the body payload from the attacker.
<form action="..." method="post">
<input type="text" name="name" value="value">
</form>
<script>
document.forms[0].submit();
</script>
This requires some unusual user interaction (F12), but to me still felt unexpected. It should not be possible for an attacker to prepare a request so that it contains their malicious POST body with the user's SameSite=Strict cookies without it being clearly visible.
The request that the DevTools sources tab sends should inherit the SameSite-ness (initiator?) of the original request so that it is as identical as possible, and doesn't increase the risk of CSRF.
Summary
DevTools Sources panel with Service Worker causes POST to be resent bypassing SameSite=Strict
Custom Questions
Reporter credit:
Jorian Woltjer, Mian, bug_blitzer
Additional Data
Category: Security
Chrome Channel: Not sure
Regression: No \
Context
Chrome DevTools includes a Sources panel that displays the source code of the current page and its associated files. To populate that panel, DevTools takes resources from the cache, or re-fetches them when they are not cached. The re-fetch is a new request initiated from the current site. When the original navigation came from cross-site, this is a contradiction, and the request for the Sources tab contains SameSite=Strict cookies even for POST requests.
The report describes how this behaviour lets an attacker combine a cross-site POST with a registered Service Worker and a user opening DevTools, so that the POST body is resent together with the user's SameSite=Strict cookies. The affected component is DevTools, the weakness is insufficient policy enforcement, and the issue was tracked as CVE-2026-3940 in the Chrome VRP. It was rated low severity and a bounty of 1000.00 USD was awarded. Credit for the report goes to Jorian Woltjer, Mian and bug_blitzer, and it was disclosed on 2026-03-10.
Setup
The reproduction uses two sites:
- The target,
jtw.sh, which sets cookies and registers a Service Worker. - The attacker's site,
vps.jorianwoltjer.com, which hosts a page that submits a cross-site POST to the target.
A local copy of the source code is provided in the attachment samesite-post-bypass-sw.zip, and it can be run with:
php -S [redacted]:8000
The only precondition on the target side is that a Service Worker is registered for it. The Service Worker does not have to do anything: it just needs to be registered. The report notes that without a registered Service Worker, the Sources panel instead shows the error "Content unavailable. Resource was not cached" in place of the content.
On the user side, the interaction required is opening DevTools on the resulting page, either by right-clicking and choosing Inspect, or by pressing Ctrl+Shift+I or F12.
Finding it
The researcher observed that the Sources panel fetches resources from the cache, or re-fetches them if needed. The re-fetch is initiated from the current site. When the original navigation was cross-site, this creates a contradiction: the new request for the Sources tab is treated as coming from the target site itself, so it carries SameSite=Strict cookies even for POST requests.
The behaviour looked wrong because it should not be possible for an attacker to prepare a request that contains their malicious POST body together with the user's SameSite=Strict cookies, without that request being clearly visible.
A second observation narrowed the condition: the re-fetch only happens when a Service Worker is registered for the target. Without one, the panel shows the "Content unavailable. Resource was not cached" error instead. The Service Worker's behaviour is irrelevant; its mere registration is enough to trigger the re-fetch path.
Exploitation
Step 1: prime the target
Visit the target page so that cookies are set and a Service Worker is registered on jtw.sh:
https://jtw.sh/samesite-post-bypass-ce7139c3/target-sw.php
This sets cookies and registers the Service Worker that the later re-fetch depends on.
Step 2: visit the attacker's page
Visit the attacker-controlled page:
https://vps.jorianwoltjer.com/samesite-post-bypass-ce7139c3/csrf-sw.html
That page performs a simple top-level form submission to the target. The payload shown in the report is:
<form action="..." method="post">
<input type="text" name="name" value="value">
</form>
<script>
document.forms[0].submit();
</script>
The form posts to the target with a body containing the attacker's chosen field. Because the submission is cross-site, the browser does not attach the target's SameSite=Strict cookies, so it should not work initially.
Step 3: open DevTools
On the resulting page, open DevTools by right-clicking and choosing Inspect, or by pressing Ctrl+Shift+I or F12.
Step 4: the request is resent
In the background, a malicious POST request with all cookies is now sent to the target. The report points to the Sources tab, viewing the target-sw.php file, to see it. A recording, samesite-post-bypass-sw.mp4, accompanies the report and shows this happening.
What happens is that the Sources panel re-fetches the resource. That re-fetch is initiated from the current site, so it is no longer treated as cross-site, and the SameSite=Strict cookies are sent along with the attacker's POST body. The re-fetch carries the attacker's POST body together with the user's SameSite=Strict cookies.
Root cause
The DevTools Sources panel re-fetches resources that are not in the cache. That re-fetch is initiated from the current site rather than inheriting the cross-site context of the original navigation. As a result, the browser's SameSite policy sees a same-site request and attaches SameSite=Strict cookies, even though the request body came from the attacker's cross-site form submission.
The Service Worker is what makes the re-fetch path reachable: without one, the panel reports "Content unavailable. Resource was not cached". The report does not explain why the Service Worker changes this, only that it does.
The re-fetch is initiated from the current site, so SameSite=Strict cookies are sent even though the original navigation was cross-site. The report's suggested correction is that the request sent by the DevTools Sources tab should inherit the SameSite-ness (initiator) of the original request, so that it is as identical as possible and does not increase the risk of CSRF.
Impact
Any site that uses a Service Worker and relies on SameSite for Cross-Site Request Forgery (CSRF) protection is vulnerable. An attacker can prepare a cross-site POST with a body of their choosing, and once the user opens DevTools on the resulting page, that body is resent with the user's SameSite=Strict cookies. The attacker cannot choose when the user opens DevTools, and the report acknowledges that this requires unusual user interaction (F12). The researcher still considered the behaviour unexpected, because an attacker should not be able to prepare a request that carries their malicious POST body together with the user's SameSite=Strict cookies without it being clearly visible.
Fix
The report does not describe a specific patch. It states what the behaviour should be: the request that the DevTools Sources tab sends should inherit the SameSite-ness (initiator) of the original request, so that it is as identical as possible and does not increase the risk of CSRF.
Variants to test
- Other DevTools panels that re-fetch resources. If the Sources panel re-fetches with a same-site initiator, other panels that load resources on demand may do the same. A positive result is a cross-site navigation followed by opening the panel, with the target's
SameSite=Strictcookies appearing on the re-fetch. - Targets with a registered Service Worker but no caching. The report notes the Service Worker does not need to do anything. A positive result is a target where the Service Worker is registered but the resource is not cached, and the panel still resends the POST with cookies.
- POST bodies with different content types. The report only shows a form submission with a text field. Trying other form encodings or body shapes on a target that relies on SameSite for CSRF protection is worth checking; a positive result is the attacker's body arriving with the user's
SameSite=Strictcookies. - Targets without a Service Worker. These are the control case: the report says the panel shows "Content unavailable. Resource was not cached" and the request is not resent. If a target without a Service Worker does resend the request, that is a different finding from the one described here.
What happened, in plain words
When you open a website, your browser stores small pieces of information called cookies. Cookies let a site remember who you are, for example that you are logged in. Some cookies are marked with a rule called SameSite=Strict, which is a safety setting: the browser will only send that cookie when the request comes from the same website. If another website tries to make your browser send a request to the target site, the browser leaves the Strict cookie out. That is how sites protect themselves against CSRF (Cross-Site Request Forgery), where an attacker's page quietly makes your browser send a request to a site you are logged in to.
This report is about a way around that protection. Chrome's built-in developer tools, DevTools, have a panel called Sources that shows the code of the page you are looking at. To fill that panel, DevTools sometimes asks the site for the files again. That new request is started by the page you are currently on, so the browser treats it as coming from the target site itself, and it attaches the SameSite=Strict cookies. If the attacker's page had earlier sent a POST request (a request that carries data, like a form submission) to the target, that request's body can be resent together with the user's Strict cookies once the user opens DevTools. The attacker cannot control when the user presses F12, so this needs unusual user interaction, but the researcher still considered it unexpected.
The affected part of Chrome is DevTools, the weakness is described as insufficient policy enforcement, and the issue was tracked as CVE-2026-3940 in the Chrome VRP. It was rated low severity, a bounty of 1000.00 USD was awarded, credit goes to Jorian Woltjer, Mian and bug_blitzer, and it was disclosed on 2026-03-10.
Context
Chrome DevTools is the set of tools built into the Chrome browser that you open with F12 or Ctrl+Shift+I. One of its panels, Sources, shows the source code of the current page and the files that belong to it. To fill the panel, DevTools takes the files from the browser's cache (a local store of previously downloaded files) or, if a file is not in the cache, asks the site for it again. That second request is called a re-fetch.
The re-fetch is a new request, and it is started from the page you are currently on. When you arrived at that page from a different site, this is a contradiction: the request for the Sources tab contains SameSite=Strict cookies even for POST requests.
The report shows how an attacker can combine three things: a cross-site POST, a registered Service Worker (a script the site installs in the browser that can handle requests for it), and the user opening DevTools. The result is that the POST body is resent together with the user's SameSite=Strict cookies.
Setup
The reproduction uses two sites:
- The target,
jtw.sh, which sets cookies and registers a Service Worker. - The attacker's site,
vps.jorianwoltjer.com, which hosts a page that submits a cross-site POST to the target.
A local copy of the source code is provided in the attachment samesite-post-bypass-sw.zip, and it can be run with:
php -S [redacted]:8000
This line starts PHP's built-in web server on port 8000, listening on all network interfaces, so you can serve the reproduction files from your own machine. php is the program, -S tells it to run a simple development server, [redacted] means every network interface, and 8000 is the port number.
The only precondition on the target side is that a Service Worker is registered for it. The Service Worker does not have to do anything: it just needs to be registered. Without one, the Sources panel instead shows the error "Content unavailable. Resource was not cached" in place of the content.
On the user side, the interaction required is opening DevTools on the resulting page, either by right-clicking and choosing Inspect, or by pressing Ctrl+Shift+I or F12.
Finding it
The researcher observed that the Sources panel fetches resources from the cache, or re-fetches them if needed. The re-fetch is initiated from the current site. When the original navigation was cross-site, this creates a contradiction: the new request for the Sources tab is treated as coming from the target site itself, so it carries SameSite=Strict cookies even for POST requests.
The behaviour looked wrong because it should not be possible for an attacker to prepare a request that contains their malicious POST body together with the user's SameSite=Strict cookies, without that request being clearly visible.
A second observation narrowed the condition: the re-fetch only happens when a Service Worker is registered for the target. Without one, the panel shows the "Content unavailable. Resource was not cached" error instead. The Service Worker's behaviour is irrelevant; its mere registration is enough to trigger the re-fetch path.
Exploitation
Step 1: prime the target
Visit the target page so that cookies are set and a Service Worker is registered on jtw.sh:
https://jtw.sh/samesite-post-bypass-ce7139c3/target-sw.php
This sets cookies and registers the Service Worker that the later re-fetch depends on. Think of it as logging in to the target site and letting it set up its helper script in your browser.
Step 2: visit the attacker's page
Visit the attacker-controlled page:
https://vps.jorianwoltjer.com/samesite-post-bypass-ce7139c3/csrf-sw.html
That page performs a simple top-level form submission to the target. The payload shown in the report is:
<form action="..." method="post">
<input type="text" name="name" value="value">
</form>
<script>
document.forms[0].submit();
</script>
Line by line:
<form action="..." method="post">starts an HTML form.actionis the address the form sends its data to (shown here as...), andmethod="post"means the data is sent in the body of a POST request rather than in the URL.<input type="text" name="name" value="value">is a text field. Its name isnameand its value isvalue, so the submitted body contains that field.</form>closes the form.<script>starts a block of JavaScript, the language browsers run inside pages.document.forms[0].submit();finds the first form on the page (forms[0]) and submits it automatically, without the user clicking anything.</script>closes the script block.
The form posts to the target with a body containing the attacker's chosen field. Because the submission is cross-site, the browser does not attach the target's SameSite=Strict cookies, so it should not work initially. In other words, the target should treat it as coming from a stranger.
Step 3: open DevTools
On the resulting page, open DevTools by right-clicking and choosing Inspect, or by pressing Ctrl+Shift+I or F12.
Step 4: the request is resent
In the background, a malicious POST request with all cookies is now sent to the target. The report points to the Sources tab, viewing the target-sw.php file, to see it. A recording, samesite-post-bypass-sw.mp4, accompanies the report and shows this happening.
What happens is that the Sources panel re-fetches the resource. That re-fetch is initiated from the current site, so it is no longer treated as cross-site, and the SameSite=Strict cookies are sent along with the attacker's POST body. The re-fetch carries the attacker's POST body together with the user's SameSite=Strict cookies.
Root cause
The DevTools Sources panel re-fetches resources that are not in the cache. That re-fetch is initiated from the current site rather than inheriting the cross-site context of the original navigation. As a result, the browser's SameSite policy sees a same-site request and attaches SameSite=Strict cookies, even though the request body came from the attacker's cross-site form submission.
The Service Worker is what makes the re-fetch path reachable: without one, the panel reports "Content unavailable. Resource was not cached". The report does not explain why the Service Worker changes this, only that it does.
The re-fetch is initiated from the current site, so SameSite=Strict cookies are sent even though the original navigation was cross-site. The report's suggested correction is that the request sent by the DevTools Sources tab should inherit the SameSite-ness (initiator) of the original request, so that it is as identical as possible and does not increase the risk of CSRF.
Impact
Any site that uses a Service Worker and relies on SameSite for CSRF protection is vulnerable. An attacker can prepare a cross-site POST with a body of their choosing, and once the user opens DevTools on the resulting page, that body is resent with the user's SameSite=Strict cookies. The attacker cannot choose when the user opens DevTools, and the report acknowledges that this requires unusual user interaction (F12). The researcher still considered the behaviour unexpected, because an attacker should not be able to prepare a request that carries their malicious POST body together with the user's SameSite=Strict cookies without it being clearly visible.
Fix
The report does not describe a specific patch. It states what the behaviour should be: the request that the DevTools Sources tab sends should inherit the SameSite-ness (initiator) of the original request, so that it is as identical as possible and does not increase the risk of CSRF.
Variants to test
- Other DevTools panels that re-fetch resources. If the Sources panel re-fetches with a same-site initiator, other panels that load resources on demand may do the same. A positive result is a cross-site navigation followed by opening the panel, with the target's
SameSite=Strictcookies appearing on the re-fetch. - Targets with a registered Service Worker but no caching. The report notes the Service Worker does not need to do anything. A positive result is a target where the Service Worker is registered but the resource is not cached, and the panel still resends the POST with cookies.
- POST bodies with different content types. The report only shows a form submission with a text field. Trying other form encodings or body shapes on a target that relies on SameSite for CSRF protection is worth checking; a positive result is the attacker's body arriving with the user's
SameSite=Strictcookies. - Targets without a Service Worker. These are the control case: the report says the panel shows "Content unavailable. Resource was not cached" and the request is not resent. If a target without a Service Worker does resend the request, that is a different finding from the one described here.
Glossary
- API: a defined way for one piece of software to ask another for something, like a menu of requests a program accepts.
- Browser cache: a local store where the browser keeps copies of files it has already downloaded, so it does not have to download them again.
- Chrome VRP: Chrome's Vulnerability Reward Program, which pays researchers for reporting security bugs in Chrome.
- Cookie: a small piece of data a website asks the browser to store and send back with later requests, often used to remember that you are logged in.
- CSRF (Cross-Site Request Forgery): an attack where another website makes your browser send a request to a site you are logged in to, without your intent.
- CVE: a public identifier for a known security vulnerability, here CVE-2026-3940.
- DevTools: the developer tools built into Chrome, opened with F12 or Ctrl+Shift+I, used to inspect pages and their files.
- Initiator: the page or script that started a request; the browser uses it to decide whether a request is same-site or cross-site.
- POST request: an HTTP request that carries data in its body, commonly used when submitting a form.
- Re-fetch: asking the site for a file again because it was not available in the cache.
- SameSite=Strict: a cookie setting that tells the browser to send the cookie only when the request comes from the same site, not from another site.
- Service Worker: a script a website installs in the browser that can handle requests for that site; here it only needs to be registered, not to do anything.
- Sources panel: the DevTools tab that shows the source code of the current page and its associated files.
- Top-level form submission: a form submission that replaces the whole page you are looking at, rather than happening quietly in the background.