Skip to content
Disclosed report Intermediate CVE-2026-6774

Audio Worklet can execute dynamic code without `unsafe-eval` in CSP

Firefox did not enforce the Content Security Policy restriction on dynamic code evaluation inside Audio Worklet code, so eval() ran even though the policy omitted unsafe-eval. An attacker who could get script onto a page with such a policy could run dynamically generated code that the policy was meant to block.

lebr0nli Follow

Originally disclosed on Mozilla

  • Fixed in 18 days
  • Paid in 25 days
  • Disclosed after 18 days

Created attachment 9545212 poc.tar

VULNERABILITY DETAILS

Content Security Policy (CSP) is not properly enforced for Audio Worklet. Specifically, Audio Worklet can execute dynamic code (via eval() and similar constructs) even when the unsafe-eval is absent from the CSP.

VERSION

Firefox Version: 147.0.3 stable

The vulnerability is also present in Firefox 149.0a1 nightly

REPRODUCTION CASE

  1. Host the provided code (index.html and script.js in poc.tar) on a local server by running python3 -m http.server -b 127.0.0.1 1337 or php -S 127.0.0.1:1337 in the directory containing the files.
  2. Navigate to http://127.0.0.1:1337/#6*7 in Firefox.
  3. Although the CSP is set to default-src 'none'; script-src 'self' 'unsafe-inline';, the Audio Worklet should successfully execute eval() and the page should display the result 42 of eval("6*7"). This demonstrates that CSP is not properly enforced for Audio Worklet.

When visiting the same page in Chromium, an error message appears indicating that eval() is blocked by CSP instead of showing 42. I think it should be the expected behavior.

CREDIT INFORMATION

Reporter credit: lebr0nli of National Yang Ming Chiao Tung University, Dept. of CS, Security and Systems Lab.

The original report as published on Mozilla's Bugzilla, by lebr0nli. 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 Audio Worklet's script execution context was not wired into the CSP check that blocks eval and similar dynamic code evaluation.

Impact

A page relying on CSP to block dynamic code could still have such code executed through an Audio Worklet, weakening the defence that policy was meant to provide; the report shows this in Firefox only, and Chromium blocked it as expected.

What the attacker needed

Attacker-controlled script on a CSP-protected page; victim uses Firefox

How it was found

  1. Serve the proof-of-concept files from a local web server.
  2. Open the page in Firefox, which carries a CSP that forbids eval.
  3. Observe that the Audio Worklet still evaluates the expression and the page shows the result.

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 is a set of rules a website sends to the browser to limit what scripts may do, for example banning eval(), which turns text into running code. Firefox applied these rules to normal page scripts but not to code running inside an Audio Worklet, a background audio-processing context. So a page that said 'no eval' could still run eval there, while Chromium blocked it.

More by lebr0nli

View all

3 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

Same bug class and techniques, clearest first.