Closed Bug 2056571 (CVE-2026-74942) Opened 4 months ago Closed 4 months ago

Firefox Remote Settings content-signature bypass

Categories

(Firefox :: Remote Settings Client, defect, P1)

defect

Tracking

()

RESOLVED FIXED
155 Branch
Tracking Status
firefox-esr115 154+ fixed
firefox-esr140 154+ fixed
firefox-esr153 154+ fixed
firefox153 --- wontfix
firefox154 + fixed
firefox155 + fixed

People

(Reporter: galank, Assigned: leplatrem)

References

Details

(Keywords: csectype-priv-escalation, reporter-external, sec-moderate, Whiteboard: [client-bounty-form][adv-main154+][adv-esr153.1+][adv-esr140.14+][adv-esr115.39+])

Attachments

(1 file, 5 external files)

Attached file poc-attachments.zip —

Summary

Firefox's Remote Settings client persists unverified records to the local database before verifying the collection's content signature, and only rolls them back when the failure is an InvalidSignatureError. An attacker who controls a Remote Settings response (a compromised Remote Settings server/CDN, or an on-path attacker able to intercept the TLS connection to firefox.settings.services.mozilla.com — the exact threat content-signature exists to defend against) can force a different verification error (a malformed signature, or a failing x5u cert-chain fetch), which skips the rollback. The unverified attacker records remain in IndexedDB and are served to consumers via the default read path. This is a bypass of the content-signature integrity mitigation for the channel that ships add-on/gfx blocklists, the OneCRL certificate-revocation store, and remote configuration to the entire release population.

Impact

Content signature is the trust anchor that lets Firefox accept Remote Settings data without trusting the server — so a compromised RS server/CDN cannot push malicious data. This bug nullifies that guarantee: an attacker in control of the response can inject unverified records (e.g. remove a OneCRL entry to un-revoke a malicious intermediate certificate, remove an add-on/plugin blocklist entry, or push attacker-chosen remote config) and have them accepted and served to clients. Injected data is cleaned on the next honest sync (the real signature fails over the merged set) but persists for the duration of the attacker's control of the channel, and indefinitely under continued interception (the up-to-date-skip path, remote-settings.sys.mjs:778, does not re-verify once attacker metadata is stored).

Affected versions

Current mozilla-central HEAD 446c6e60 (2026-07-16) and, by inspection, all shipping branches — the _importChanges error handling is long-standing. Firefox desktop + Android + iOS use the same services/settings client.

The bug (source, verified at 446c6e60)

  1. Write before verify. RemoteSettingsClient.sys.mjs:1210 — db.importChanges(metadata, remoteTimestamp, remoteRecords, { clear: retry }); on the first attempt retry === false, so clear:false merges the attacker's records into IndexedDB before any verification.
  2. Verify after write. :1218-1224 — validateCollectionSignature(newRecords, remoteTimestamp, metadata) runs on the already-persisted data.
  3. Rollback gated on one error type. :1229 — if (!(e instanceof InvalidSignatureError)) throw e; re-throws without db.clear()/restore; the cleanup at :1244-1273 is reachable only for InvalidSignatureError.
  4. Only a well-formed-but-wrong signature is InvalidSignatureError. validateCollectionSignature:1102-1122 produces InvalidSignatureError only on the verifier's resolve-false path. A malformed signature, or a failing Utils.fetch(x5u) (:1099, no scheme/host allowlist), makes asyncVerifyContentSignature reject.
  5. The verifier rejects (not resolve-false) on malformed input. ContentSignatureVerifier.cpp:128-131 maps only NS_ERROR_INVALID_SIGNATURE → NS_OK (→ resolve false, the safe path); every other failure returns the raw error → CallCallback (:143) rejects → the JS await throws a non-InvalidSignatureError → step 3 re-throws without cleanup. The attacker fully controls the changeset JSON (only truthiness of x5u/signature is checked, :1093), so they can deliberately choose a malformed signature to take this branch.
  6. Served without re-verification. get() defaults verifySignature:false (:457) and the read-time re-check is double-gated this.verifySignature && verifySignature (:615); get() returns db.list() straight from IndexedDB (:570). No production consumer passes verifySignature:true, so the sync-time gate (the one with the hole) is the only enforcement.

Reproduction — REPRODUCED END-TO-END on Firefox (not source-analysis)

Ran against a Firefox Nightly artifact build at 446c6e60 via the attached xpcshell test (test_content_signature_reject_persist.js, drop-in to services/settings/test/unit/). Serve, from the Remote Settings endpoint (compromised server/CDN or TLS MITM), a changeset with attacker records and metadata.signatures = [{ x5u: <valid Mozilla chain>, signature: "AAAA" }] — "AAAA" is a cleanly-formed base64 value that decodes to 3 bytes (odd length), which the real NSS verifier rejects at ContentSignatureVerifier.cpp:355 (rawSignatureItem.len % 2 != 0 → NS_ERROR_FAILURE), i.e. a reject, not InvalidSignatureError.

Observed at HEAD (unpatched): sync error: NS_ERROR_FAILURE (confirming the non-InvalidSignatureError path); then RemoteSettings("<collection>").get() → ["cliff-inert-attacker-record"] — the unverified attacker record is served. With the attached patch: the same test → get() → [] (record cleared). The test therefore fails at HEAD and passes with the fix — it is a ready-to-land regression test. (A malformed-base64 signature, or an x5u returning non-PEM content, are additional triggers of the same reject path.)

Fix

Minimal (attached patch rs-content-sig-rollback.patch): roll back on any verification failure, not just InvalidSignatureError — remove the early if (!(e instanceof InvalidSignatureError)) throw e; and let the existing clear/restore logic run for all errors (guarding the local-data re-check so it can't itself re-introduce the gap). Verified to apply cleanly at 446c6e60; the valid-signature and InvalidSignatureError paths are unchanged.
Structural (recommended): verify the candidate records before db.importChanges, matching the already-correct pullStartupBundle pattern (remote-settings.sys.mjs:303-324), so unverified bytes are never written. Additionally, add an https-scheme + Mozilla-host allowlist on x5u (:1099) to remove the fetch-failure reject trigger and the associated SSRF/privacy surface.

Severity note for the committee (mitigation bypass; precondition acknowledged)

We want to be upfront about the precondition and let the impact speak for itself. Precondition: the attacker must control the Remote Settings response for the targeted client — a compromised Remote Settings server/CDN, or an on-path/TLS-MITM position against firefox.settings.services.mozilla.com. We are not claiming a no-precondition, normal-browsing compromise.

Why it still matters, despite the precondition: content-signature verification is the security mitigation that exists specifically to make that precondition survivable — the entire design goal is that Firefox accepts Remote Settings data without trusting the server, so that a compromised server or on-path attacker cannot push malicious data. This report is a bypass of that exact mitigation. Concretely, an attacker who has reached the precondition can:

  • Un-revoke a malicious/mis-issued intermediate CA by dropping its OneCRL entry — directly re-enabling the certificate compromise that OneCRL was pushed to contain; and/or
  • remove an add-on/plugin/gfx blocklist entry, or push attacker-chosen remote configuration,

all served to the client as if trusted. So while the entry is gated on controlling the channel, the consequence is defeat of the fleet's second line of defense for exactly that scenario.

We think this fits the exploit-mitigation-bypass eligibility category (and its bounty modifier) regardless of the raw severity number, and we'd argue for sec-high on the OneCRL-un-revocation impact — but we defer to the committee's rating and are happy to provide the xpcshell PoC, the debug transcript (attached), and to coordinate a disclosure date. If a related report already exists internally, please treat this as an independent, source-verified confirmation with a ready-to-land fix + regression test.

AI-assistance disclosure

This issue was identified and validated with substantial AI assistance (Anthropic Claude / Claude Code), used as a research tool by a human researcher. Every receipt was human-verified against mozilla-central source at 446c6e60 (file:line), and the control-flow was traced end-to-end (JS + the C++ verifier's error mapping) before this report.

Flags: sec-bounty?
Component: Security → Remote Settings Client

The rating assigned by our bug rating tool (currently under development) is:

Rating: sec-moderate

Explanation: Verified real bug. In RemoteSettingsClient._importChanges, remote records are written to IndexedDB with clear:false BEFORE signature verification (line 1210), and rollback (db.clear) is gated on e instanceof InvalidSignatureError (line 1229). validateCollectionSignature only yields InvalidSignatureError on the verifier's resolve-false path; a malformed signature or failing x5u fetch makes ContentSignatureVerifier.cpp return NS_ERROR_FAILURE (line 355-357), mapped to a promise reject (only NS_ERROR_INVALID_SIGNATURE is mapped to resolve-false at 128-131), so the JS throw is a non-InvalidSignatureError and the tampered DB is not cleared. get() defaults verifySignature:false (455) with a double-gated read-time recheck (615), so the unverified records are served. This is a genuine bypass of the content-signature integrity mitigation (blocklists/OneCRL/remote config). Not sec-high: it requires the attacker to already control the RS response channel (compromised server/CDN, or a TLS MITM of firefox.settings.services.mozilla.com) — content-signature is a defense-in-depth layer behind TLS, so the required attacker positioning plus transient persistence (cleared on next honest sync) caps this at sec-moderate (a would-be-high mitigation bypass limited by attacker-capability preconditions).

Keywords: sec-moderate

Not sec-high: it requires the attacker to already control the RS response channel (compromised server/CDN, or a TLS MITM of firefox.settings.services.mozilla.com) — content-signature is a defense-in-depth layer behind TLS

The analysis is wrong: content signatures were a key part of the remote-settings design precisely because we didn't trust the CDN and know a fair percentage of our users are MITM'd by corporate and anti-virus proxies. Both are probably fine in practice, but not good enough for the sensitivity of remote-settings or updates (another feature that uses content signatures).

Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(twsmith)

Is it easy to make RS not write before the signature verification? That would seem to be the most thorough fix here.

Flags: needinfo?(mathieu)

It would require a fair amount of code change, but technically doable.
Writing to a temporary place (or with a prefix) and swapping when signature is valid could also work.

Flags: needinfo?(mathieu)
Assignee: nobody → mathieu
Severity: -- → S2
Priority: -- → P1
Attached file (secure) —
Flags: needinfo?(twsmith)

:leplatrem, please update all release status flags to reflect the affected/unaffected/disabled state correctly. Which branches (beta, release, and/or ESR) are affected by this flaw?

Flags: needinfo?(mathieu)
Group: firefox-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 155 Branch

AFAICT this needs uplift requests for all supported branches except Release.

Flags: needinfo?(mathieu)
Attachment #9618195 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, users are not fully protected against MiTM attacks on the Remote Settings data
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Risk is low because this code is only executed when the RS signature verification fails. Vast majority of our users won't execute this code change.
  • String changes made/needed?: None
  • Is Android affected?: yes

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, users are not fully protected against MiTM attacks on the Remote Settings data
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Risk is low because this code is only executed when the RS signature verification fails. Vast majority of our users won't execute this code change.
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9618197 - Flags: approval-mozilla-esr153?

firefox-esr140 Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, users are not fully protected against MiTM attacks on the Remote Settings data
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Risk is low because this code is only executed when the RS signature verification fails. Vast majority of our users won't execute this code change.
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9618240 - Flags: approval-mozilla-esr140?
Attachment #9618241 - Flags: approval-mozilla-esr115?

firefox-esr115 Uplift Approval Request

  • User impact if declined/Reason for urgency: Without this, users are not fully protected against MiTM attacks on the Remote Settings data
  • Code covered by automated testing?: no
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Risk is low because this code is only executed when the RS signature verification fails. Vast majority of our users won't execute this code change.
  • String changes made/needed?: None
  • Is Android affected?: yes
Attachment #9618195 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Duplicate of this bug: 2059217
Attachment #9618241 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Attachment #9618240 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9618197 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+
QA Whiteboard: [sec] [uplift] [qa-triage-done-c155/b154]
Flags: needinfo?(mathieu)
Whiteboard: [client-bounty-form] → [client-bounty-form][adv-main154+][adv-esr153.1+][adv-esr140.14+][adv-esr115.39+]
Alias: CVE-2026-74942

(In reply to Daniel Veditz [:dveditz] from comment #2)

Not sec-high: it requires the attacker to already control the RS response channel (compromised server/CDN, or a TLS MITM of firefox.settings.services.mozilla.com) — content-signature is a defense-in-depth layer behind TLS

The analysis is wrong: content signatures were a key part of the remote-settings design precisely because we didn't trust the CDN and know a fair percentage of our users are MITM'd by corporate and anti-virus proxies. Both are probably fine in practice, but not good enough for the sensitivity of remote-settings or updates (another feature that uses content signatures).

We reviewed this further and our severity guidelines and agree this is an issue (i.e. TLS should not be the only line of defense) but that requiring compromise of it does limit it in capability and make it a sec-moderate

Flags: sec-bounty? → sec-bounty+
Keywords: sec-high → sec-moderate
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: