Closed Bug 2064277 Opened 1 day ago Closed 12 hours ago

UrlbarChild hands parent-sent payloads to content without cloning them into its realm

Categories

(Firefox :: Address Bar, defect)

defect

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: dao, Assigned: dao)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sng][mcab-hnt])

Attachments

(2 files)

UrlbarChild's dispatches into the child controller -- #updateEngineStore, #invokeContentAction, #receiveNotify -- waive Xrays on the controller so its methods are callable, but pass the message payload through unchanged. That payload is a structured clone living in the actor's system realm, so a content-realm <moz-urlbar> sees an Xray over it, and an Xray over a chrome array denies Symbol.iterator. Iterating the engine-store snapshot therefore throws "Permission denied to access property Symbol.iterator".

The port's returns already handle this: sendQuery, getFixupPrimitives and getPref all Cu.cloneInto(..., win). Only the parent-to-child dispatches were missed.

#receiveNotify needs more than a clone. It carries a UrlbarQueryContext that fromWire builds in the actor's realm, and cloning would flatten it to a plain object. Content has that class, so deserializing on the content side is the likely fix.

Whiteboard: [sng][mcab-hnt]

The port's returns are already cloned; the parent's dispatches into the child
controller weren't, so a content-realm input saw an Xray over an object in this
realm and was denied even Symbol.iterator -- iterating the engine-store
snapshot threw.

Notify has the same gap and isn't fixed here: it carries a UrlbarQueryContext
that fromWire builds in this realm, and cloning would flatten it. Content has
the class, so deserializing there is likely the answer.

Assignee: nobody → dao+bmo
Status: NEW → ASSIGNED

The remaining half of the previous patch, and the one a clone can't fix: the
actor deserialized the wire form into a UrlbarQueryContext in its own realm, so
a content-realm view got an Xray over it. That reads every property as
undefined rather than throwing, so a query produced no rows and no error.

The wire form is plain data, so it crosses as one and the child controller builds
the context from it. That has to happen before notify inspects id to drop a
stale query's results.

Reverted this because it was causing mochitests failures in browser_searchbar_new.js.

  • Revert link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | accessible/tests/browser/tree/browser_searchbar_new.js | test_searchbar_a11y_tree - [DOM node id: searchbar-new, role: grouping, address: [xpconnect wrapped nsIAccessible]] has an extra child at index 1 : [role: section, address: [xpconnect wrapped nsIAccessible]]
Status: ASSIGNED → RESOLVED
Closed: 12 hours ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: