Closed Bug 2032382 Opened 7 months ago Closed 7 months ago

RecvBlobURLDataRequest does not ValidatePrincipal before GetDataEntry authorization checks

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2014103

People

(Reporter: yuki.detective, Unassigned)

Details

(Keywords: ai-involved, reporter-external)

Steps to reproduce:

Code audit of ContentParent IPC handlers accepting nsIPrincipal*
in mozilla-central (rev 34fc93ba, 2026-04-12).

  1. RecvBlobURLDataRequest (ContentParent.cpp:7394) accepts
    nsIPrincipal* aTriggeringPrincipal and nsIPrincipal* aLoadingPrincipal
    from a content process without calling ValidatePrincipal on either.

  2. Both principals are passed directly to
    BlobURLProtocolHandler::GetDataEntry (BlobURLProtocolHandler.cpp:817)
    which uses them for authorization:

    • Line 846: if aLoadingPrincipal->IsSystemPrincipal(),
      OriginAttributes comparison is skipped
    • Line 853: aTriggeringPrincipal->Subsumes(info->mPrincipal)
      gates access to the blob data
  3. By contrast, RecvStoreAndBroadcastBlobURLRegistration (line 5845)
    validates the principal for blob URL registration:
    ValidatePrincipal(aPrincipal, {ValidatePrincipalOptions::AllowSystem})

    The blob URL write path is protected; the read path is not.

Actual results:

A compromised content process may be able to forge a triggering
principal matching another origin's blob URL owner, and a
SystemPrincipal as loading principal, to bypass both authorization
checks in GetDataEntry and read cross-origin blob data.

Blob URL strings may be available to the compromised process via
the SendBlobURLRegistration broadcast mechanism
(ContentParent.cpp:5793), though broadcast reach may be filtered
by mLoadedOriginHashes.

This has not been runtime-demonstrated; the finding is based on code audit.

Expected results:

RecvBlobURLDataRequest should call ValidatePrincipal on both
aTriggeringPrincipal and aLoadingPrincipal, consistent with how
RecvStoreAndBroadcastBlobURLRegistration and other IPC handlers
(RecvSetClipboard, RecvGetClipboardDataSnapshot, RecvCreateWindow)
validate their principal parameters.

A content process should not be able to send a SystemPrincipal or a
principal from a different site via this IPC message.

See also: Bug 1421099 (blob URL OriginAttributes isolation, sec-moderate)

Status: UNCONFIRMED → RESOLVED
Closed: 7 months ago
Duplicate of bug: 2014103
Resolution: --- → DUPLICATE
Group: firefox-core-security
Component: Untriaged → DOM: Content Processes
Product: Firefox → Core
You need to log in before you can comment on or make changes to this bug.