Skip to content
File upload Disclosed report Advanced CVE-2026-8971

jar: URL %00 still enables download filename spoofing & MIME confusion via resource:// — incomplete fix for CVE-2025-1936 / CVE-2026-2790

A null byte in a jar: or resource:// URL path is still accepted by Firefox's URL parser, so the filename and MIME type shown to the user are taken from the text after the null byte rather than the real resource. An attacker could make a download appear as an executable with a chosen name, or have content served under a misleading MIME type, including through moz-extension:// URLs reachable from a web page.

Surya Dev Singh Follow

Originally disclosed on Mozilla

  • Fixed in 5 days
  • Paid in 6 days
  • Disclosed after 5 days

Created attachment 9570825 test.zip

Background

This is a third bug in the same vulnerability class in Firefox's jar: URL protocol handler. The two prior bugs in this chain are:

  • CVE-2025-1936 (Bug 1940027) — Single %00 in jar: URL caused strlen() truncation in nsZipArchive::GetItem, mismatching the loaded file vs applied MIME type. Fixed by replacing char* / strlen with nsACString.
  • CVE-2026-2790 (Bug 2008426)— Double-encoded %2500 bypassed the nsACString fix because %2500 decoded to %00 (not \0) in one pass. Fixed by disabling content sniffing for JAR channels entirely.

Neither fix added upfront rejection of %00 at the URL parser level. The null byte is still accepted in jar: and resource:/// URL paths and reaches downstream code, producing two exploitable effects.


Vulnerability

A %00 embedded in a jar: URL entry path still causes two distinct, exploitable behaviors:

Vector 1 : Download Filename Spoofing

Navigating to: jar:file:///path/to/archive.zip!/%00://evil.exe

Firefox initiates a download with the filename evil.exe.
The attacker controls the filename and extension completely.
The actual content is irrelevant however the name shown to the user is spoofed.


Issue 2 — MIME Type Confusion (still present after CVE-2025-1936 (bug 1940027))

jar:file:///C:/Users/<user>/Desktop/test.zip!/%00style.css.html

Serves the resource under text/html MIME type.

jar:file:///C:/Users/<user>/Desktop/test.zip!/%00.xml

Firefox throws XML Parsing Error — confirming that the MIME type is being derived from the extension following the null byte, not from the actual content. The null byte reaches downstream MIME resolution code unvalidated

Same behavior confirmed on resource:/// internal protocol:

resource:///%00.html       
resource:///%00test/  

This further extends the attack surface, as resource:/// is the underlying protocol for moz-extension://.


Why moz-extension:// Makes This Web-Reachable

As confirmed by Rob Wu (Mozilla) in Bug 1940027 Comment 16, moz-extension:// resolves internally to jar: URLs. Extensions with wildcard web_accessible_resources expose these to web content.

A malicious web page can trigger:

JavaScript
window.location = "moz-extension://<uuid>/logo.png%00://update.exe";

Result: the victim sees a download dialog for update.exe — served from a legitimate installed extension with a fully attacker-controlled filename.


Setup (to reproduce Issues 1 & 2)

Python
import zipfile
with zipfile.ZipFile("test.zip", "w") as z:
    z.writestr("image.jpg", "test")
    z.writestr("style.css", "test")

Root Cause

The fix for CVE-2025-1936 replaced strlen/char* with nsACString.
The fix for CVE-2026-2790 disabled content sniffing for JAR channels.
Neither fix rejects %00 as invalid at the URL parser level.
All three issues share the same root cause.

The original report as published on Mozilla's Bugzilla, by Surya Dev Singh. 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 URL parser never rejects a null byte in jar: and resource:// paths, so downstream code derives the filename and MIME type from the text after the null byte.

Impact

A malicious page could make a victim see a download dialog for an attacker-chosen executable name served from a legitimate installed extension, and content could be served under a misleading MIME type; the text does not show code execution.

What the attacker needed

An installed extension with wildcard…; victim visits a malicious page; a crafted jar: or resource:// URL

The fix

The URL parser should reject null bytes in jar: and resource:// paths up front rather than relying on downstream fixes.

How it was found

  1. Create a zip archive containing a couple of harmless files.
  2. Open a jar: URL pointing into that archive with a null byte in the entry path.
  3. Observe that Firefox starts a download whose filename comes from the text after the null byte.
  4. Open a jar: URL with a null byte followed by an html or xml extension and observe the MIME type follows that extension.
  5. Repeat the same with resource:/// URLs to confirm the same behaviour.

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 null byte is a character that marks the end of a string in some programming languages. Firefox's jar: URLs point inside a zip archive, and if a null byte is placed in the path, different parts of the browser disagree about where the name ends. That lets a page control the filename a download is saved as, or the type the content is treated as.

What is File upload?

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.

More by Surya Dev Singh

View all

4 more disclosed reports, 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.

Unrestricted file upload

The lesson behind this report.

An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.