Closed Bug 2023414 Opened 8 months ago Closed 8 months ago

RecvBlobURLDataRequest missing ValidatePrincipal — cross-origin blob theft

Categories

(Core :: DOM: Content Processes, defect)

defect

Tracking

()

RESOLVED DUPLICATE of bug 2014103

People

(Reporter: s3zer0, Unassigned)

References

()

Details

(Keywords: ai-involved, reporter-external, Whiteboard: [client-bounty-form])

Attachments

(1 file)

Attached file BUG12_code.txt —

Issue

ContentParent::RecvBlobURLDataRequest accepts aTriggeringPrincipal and aLoadingPrincipal from the content process without calling ValidatePrincipal(). A compromised content process can forge a principal to access blob URL data from other origins.

Discovery

Found by auditing ContentParent.cpp Recv* handlers that accept nsIPrincipal* parameters for missing ValidatePrincipal() calls.

Environment

  • Firefox 150.0a1 (nightly)
  • All platforms
  • Default configuration

Steps to Reproduce

  1. Origin A creates: URL.createObjectURL(new Blob(["secret"])).
  2. A compromised content process (Origin B) sends PContent::BlobURLDataRequest with a forged system/expanded principal as aTriggeringPrincipal.
  3. RecvBlobURLDataRequest passes the unvalidated principal to BlobURLProtocolHandler::GetDataEntry().
  4. GetDataEntry checks aTriggeringPrincipal->Subsumes(info->mPrincipal) — forged principal passes.
  5. Blob data returned to attacker.

Actual Results

// dom/ipc/ContentParent.cpp:7394
mozilla::ipc::IPCResult ContentParent::RecvBlobURLDataRequest(
    const nsACString& aBlobURL, nsIPrincipal* aTriggeringPrincipal,
    nsIPrincipal* aLoadingPrincipal, ...) {
  // NO ValidatePrincipal(aTriggeringPrincipal)!
  // NO ValidatePrincipal(aLoadingPrincipal)!
  BlobURLProtocolHandler::GetDataEntry(
      aBlobURL, getter_AddRefs(blobImpl), aLoadingPrincipal, ...);

Expected Results

Add ValidatePrincipal() for both principals before use.

Additional Context

Same pattern found in:

  • RecvLoadURIExternal (line 4674): aTriggeringPrincipal + aRedirectPrincipal unvalidated
  • RecvStorageAccessPermissionGrantedForOrigin (line 6574): aTrackingPrincipal unvalidated
  • RecvPContentPermissionRequestConstructor (line 5175): aPrincipal + aTopLevelPrincipal unvalidated
Flags: sec-bounty?
Group: firefox-core-security → dom-core-security
Status: UNCONFIRMED → RESOLVED
Closed: 8 months ago
Component: Security → DOM: Content Processes
Duplicate of bug: 2014103
Product: Firefox → Core
Resolution: --- → DUPLICATE
Flags: sec-bounty? → sec-bounty-
Group: dom-core-security
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: