Closed Bug 2022726 (CVE-2026-6777) Opened 6 months ago Closed 6 months ago

SSRF and DNS hijacking via unvalidated TRR server URL in RecvPDNSRequestConstructor

Categories

(Core :: Networking: DNS, defect, P2)

defect

Tracking

()

RESOLVED FIXED
150 Branch
Tracking Status
firefox-esr115 --- wontfix
firefox-esr140 --- wontfix
firefox148 --- wontfix
firefox149 --- wontfix
firefox150 + fixed

People

(Reporter: b00rito.dumb, Assigned: valentin)

References

(Blocks 1 open bug)

Details

(4 keywords, Whiteboard: [necko-triaged][necko-priority-next][adv-main150+])

Attachments

(2 files)

Steps to reproduce:

  1. A compromised content process calls SendPDNSRequestConstructor with:
  2. The parent/socket process receives the message in
    NeckoParent::RecvPDNSRequestConstructor (NeckoParent.cpp:549-560)
  3. The handler passes aTrrServer directly to DNSRequestHandler::DoAsyncResolve
    with no validation

Actual results:

RecvPDNSRequestConstructor performs zero validation on the aTrrServer URL --
no scheme check, no allowlist, no comparison against user-configured TRR URI.
The arbitrary URL flows through to TRR::CreateQueryURI (TRR.cpp:147-164),
which uses it directly as the DNS-over-HTTPS endpoint.

Additionally, nsHostResolver (line 1073-1076) forces TRR_ONLY_MODE when a
custom TRR server is specified, overriding the user's DNS configuration even
if TRR is disabled (network.trr.mode = 0).

This enables:

  • SSRF from the unsandboxed parent/socket process to arbitrary URLs including
    internal network addresses (192.168.x.x, 10.x.x.x, 127.0.0.1)
  • DNS query exfiltration to attacker-controlled servers
  • DNS hijacking for the compromised process's own requests

A related handler, RecvSpeculativeConnect (NeckoParent.cpp:562-588), accepts
an arbitrary nsIURI* and initiates TCP connections from the parent process
without origin validation, enabling port scanning of internal networks.

Expected results:

Content processes should not be able to specify custom TRR server URLs.
RecvPDNSRequestConstructor should reject any non-empty aTrrServer from a
content process with IPC_FAIL, since DNS resolution should use only the
system or user-configured TRR server. If per-request TRR overrides are
needed for some reason, the URL should at minimum be validated against an
allowlist or restricted to the user-configured TRR URI.

Group: core-security → network-core-security

The custom URL was previously used to do some performance testing of DoH servers other than the default one.
It's only used at DNSLookup.doLookup, and we don't actually run this in release.
We might want to remove this, or otherwise completely ignore the TRR server parameter coming from the content process.

Blocks: doh
Severity: -- → S3
Keywords: sec-low
Priority: -- → P2
Whiteboard: [necko-triaged][necko-priority-next]

Note that even if the attacker process manages to poison the DNS cache via this attack, TLS certificates are still checked properly.

Duplicate of this bug: 2023309
Attached file (secure)
Assignee: nobody → valentin.gosu
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Pushed by valentin.gosu@gmail.com: https://github.com/mozilla-firefox/firefox/commit/ef598a2de8f5 https://hg.mozilla.org/integration/autoland/rev/109fea20f129 Do not allow trrServer in DNS request issued by content process r=necko-reviewers,kershaw
Group: network-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 150 Branch
QA Whiteboard: [qa-triage-done-c151/b150]
QA Whiteboard: [qa-triage-done-c151/b150] → [sec] [qa-triage-done-c151/b150]
Whiteboard: [necko-triaged][necko-priority-next] → [necko-triaged][necko-priority-next][adv-main150+]
Alias: CVE-2026-6777
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: