Closed Bug 2032470 Opened 7 months ago Closed 7 months ago

WindowGlobalParent::RecvUpdateDocumentSecurityInfo stores child-supplied TLS info without validation - compromised renderer spoofs padlock and certificate UI

Categories

(Core :: DOM: Security, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2014254

People

(Reporter: pakhunov.anton.n, Unassigned)

Details

(Keywords: ai-involved, reporter-external)

Attachments

(1 file)

Summary

WindowGlobalParent::RecvUpdateDocumentSecurityInfo stores a child-supplied nsITransportSecurityInfo object directly in mSecurityInfo without any validation. This is the value the browser reads to render the padlock icon and certificate details. A compromised renderer can send a forged TransportSecurityInfo and make an insecure HTTP page appear to have a valid HTTPS certificate.

The handler

// dom/ipc/WindowGlobalParent.cpp
mozilla::ipc::IPCResult WindowGlobalParent::RecvUpdateDocumentSecurityInfo(
    nsITransportSecurityInfo* aSecurityInfo) {
  mSecurityInfo = aSecurityInfo;  // stored verbatim, no validation
  return IPC_OK();
}

IPDL definition (PWindowGlobal.ipdl):

[LazySend] async UpdateDocumentSecurityInfo(
    nullable nsITransportSecurityInfo aSecurityInfo);

There is no check that aSecurityInfo corresponds to the actual TLS channel for this window, no comparison against socket-side security state, and no origin or ownership verification.

For comparison, RecvUpdateDocumentPrincipal does validate:

if (!mDocumentPrincipal->Equals(aNewDocumentPrincipal)) {
  return IPC_FAIL(this, "Trying to reuse WindowGlobalParent...");
}

RecvUpdateDocumentSecurityInfo has no equivalent check.

What mSecurityInfo drives

WindowGlobalParent::GetSecurityInfo() returns mSecurityInfo directly. This is consulted by:

  • The identity panel ("padlock" and site information UI)
  • nsSecureBrowserUI to determine which icon to display
  • Extensions via nsISecureBrowserUI::state
  • about:certificate page for certificate details

Attack path

A compromised content process at http://evil.com:

  1. Constructs a TransportSecurityInfo with a forged certificate chain for https://bank.com (the cert is real - attacker fetched it by visiting bank.com over HTTPS)
  2. Sends UpdateDocumentSecurityInfo IPC with the forged object
  3. Parent stores it in mSecurityInfo without checking it against the actual socket
  4. Browser UI reads GetSecurityInfo() and displays the padlock icon with bank.com's certificate
  5. The user sees a green padlock and bank.com's EV cert details on what is actually an HTTP page from evil.com

The content of the page (attacker-controlled) combined with the trusted certificate UI creates a phishing surface that bypasses the browser's own security indicators.

Fix

Before storing aSecurityInfo, validate that it corresponds to the actual channel security state for this window. The parent can derive the expected security info from the channel itself rather than accepting it from the child. Alternatively, reject the message if the supplied security info does not match the channel's socket security info obtained from the parent side.

Group: core-security
Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Duplicate of bug: 2014254
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: