Closed Bug 1971719 (CVE-2025-8031) Opened 7 months ago Closed 7 months ago

Strip username:password from URL in CSP reports

Categories

(Core :: DOM: Security, defect)

defect

Tracking

()

RESOLVED FIXED
141 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr128 141+ fixed
firefox-esr140 141+ fixed
firefox139 --- wontfix
firefox140 --- wontfix
firefox141 + fixed

People

(Reporter: tschuster, Assigned: tschuster)

References

(Blocks 1 open bug, )

Details

(Keywords: sec-moderate, Whiteboard: [adv-main141+][adv-ESR140.1+][adv-ESR128.13+], [wptsync upstream])

Attachments

(5 files, 2 obsolete files)

Our current implementation of 5.4. Strip URL for use in reports does not follow the specification.

  1. We don't strip username and password from the URL.
  2. We seem to allow ws: and wss: schemes. I don't find that too troubling, considering that http:/https: is allowed by the specification. We should look into what other browsers do and maybe upstream this.
  3. We strip down cross-origin URLs to the "pre-path" for frame-src/object-src directives. We should probably look into upstreaming this into specification, as it as important protection against cross-origin leaks.
Assignee: nobody → tschuster

I've filed a spec issue here: https://github.com/w3c/webappsec-csp/issues/735. I guess this makes it a bit more likely that someone will notice this bug in our implementation, but it wasn't really avoidable because there were some proposed changes to URI stripping just a few hours ago: https://github.com/w3c/webappsec-csp/pull/734.

Attachment #9494574 - Attachment description: WIP: Bug 1971719 - Align more closely with the CSP specification for #strip-url-for-use-in-reports. → Bug 1971719 - Align more closely with the CSP specification for #strip-url-for-use-in-reports. r?freddyb

I think this might qualify as sec-high like bug 1790345, because we don't strip the username:password from cross-origin URLs.

While stealing credentials via CSP reports might be really disastrous., this requires atypical user behavior (phishing) and site configurations (basic authentication)

Keywords: sec-moderate
Pushed by smolnar@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/bdbe580b6431 https://hg.mozilla.org/mozilla-central/rev/59d0086ac0d6 Align more closely with the CSP specification for #strip-url-for-use-in-reports. r=freddyb
Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 141 Branch

Any strong reason for marking 140 was wontfix? I would have probably considered uplifting this.

Flags: needinfo?(dmednikov)
Flags: needinfo?(dmednikov)

(In reply to Tom Schuster (MoCo) from comment #8)

Any strong reason for marking 140 was wontfix? I would have probably considered uplifting this.

Fx140 is now in release. This is not a suitable candidate for a dot release since it also impacts ESRs.
Tom, please add ESR128 and ESR140 uplift requests when you have a moment.

Flags: needinfo?(tschuster)

Comment on attachment 9494574 [details]
Bug 1971719 - Align more closely with the CSP specification for #strip-url-for-use-in-reports. r?freddyb

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Leaking HTTP auth username/password from cross-origin iframes.
  • User impact if declined: Stolen credentials
  • Fix Landed on Version: 141
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This only changes the reporting of CSP errors, which isn't critical. There are tests.
Flags: needinfo?(tschuster)
Attachment #9494574 - Flags: approval-mozilla-esr140?
Attachment #9494574 - Flags: approval-mozilla-esr128?

Tom, the patch does not apply cleanly to the ESR branches, could you provide ESR partches? Also, do we want to also fix ESR115? Thanks

Flags: needinfo?(tschuster)
Flags: needinfo?(tschuster)
Attachment #9494574 - Flags: approval-mozilla-esr140?
Attachment #9494574 - Flags: approval-mozilla-esr128?
Attached file (secure)
Attachment #9498830 - Flags: approval-mozilla-esr140?
Attached file (secure)
Attachment #9498831 - Flags: approval-mozilla-esr128?
Attachment #9498831 - Flags: approval-mozilla-esr115?
QA Whiteboard: [sec] [qa-triage-done-c142/b141]
Flags: qe-verify-
Attachment #9498831 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115-
Attachment #9498831 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
Attachment #9498830 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Whiteboard: [adv-main141+]
Whiteboard: [adv-main141+] → [adv-main141+][adv-ESR128.13+]
Whiteboard: [adv-main141+][adv-ESR128.13+] → [adv-main141+][adv-ESR140.1+][adv-ESR128.13+]
Attached file advisory.txt (obsolete) —
Attached file advisory.txt (obsolete) —
Attachment #9500534 - Attachment is obsolete: true
Attached file advisory.txt
Attachment #9500657 - Attachment is obsolete: true
Alias: CVE-2025-8031
Group: core-security-release
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/54499 for changes under testing/web-platform/tests
Whiteboard: [adv-main141+][adv-ESR140.1+][adv-ESR128.13+] → [adv-main141+][adv-ESR140.1+][adv-ESR128.13+], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: