Open Bug 1491018 (fission-ipc-map) Opened 6 years ago Updated 27 days ago

Create Authoritative 'This Origin to this Content Process' Infrastructure

Categories

(Core :: DOM: Content Processes, enhancement, P3)

enhancement

Tracking

()

Fission Milestone Future

People

(Reporter: tjr, Unassigned)

References

(Blocks 31 open bugs)

Details

(Keywords: sec-want)

For the fission-ipc bugs to be solved, we need to create an authoritative mapping of Content Processes -> Origin. This maps needs to be used in the Parent Process, but also propagated to all Utility Processes: Necko, RDD, Web Extensions, etc so they can use it too. (The GMP process is one-per-origin already so it shouldn't need this.) This way the non-Content Process (Parent, Necko, whatever) can validate that the Content Process they are talking to is permitted to impart actions upon the Principal/OriginAttributes/whatever they supplied over IPC. Initially, I thought we could also refactor the Actors so that an Actor instance only interacts with at most one Content Process. This means that the Content Process it interacts with is known, and there would be no need to supply a Principal or OriginAttributes in IPC methods. However that is not the case, since a single Content Process may host tabs for an origin example.com from multiple Containers, Private Browsing Modes, and First Party Isolation Contexts. So we still need to supply which of those the particular request is for, but validate that the overall origin is permissible.
Blocks: 1491113
Blocks: 1491119
I'd suggest that involving the Clients API might be a good strategy. (NB: I do see you've filed bugs against the Clients API like bug 1491113.) :bkelly's original introduction on dev-platform at https://groups.google.com/d/msg/mozilla.dev.platform/MfWMpMAuYLI/aPjQo2V_BQAJ is a good contextualizer. But in short: - We should have a Client for every global, be it window or worker. - Every Client has a unique id. (See IPCClientInfo::id https://searchfox.org/mozilla-central/rev/dd965445ec47fbf3cee566eff93b301666bda0e1/dom/clients/manager/ClientIPCTypes.ipdlh#29). - The overloaded ClientManager::CreateSource (https://searchfox.org/mozilla-central/search?q=ClientManager%3A%3ACreateSource&path=) creates the clients. It currently takes an origin and allows content processes to be authoritative. - This could be changed to take a pre-authorized "origin token"/pre-allocated id, or an existing client id for the same origin. I assume the idea for fission is that whenever we realize we want to load a document for a different origin, we go to the parent process and ask it to load that origin somewhere. The parent then decides what process to put it in. At this point it could create an entry in the Clients mapping that can be "redeemed" in the content process, with the parent also asserting that it was redeemed in the right process then the ClientSource's actor is created. In the case of a same-origin client, the API could take the existing ClientId and the parent process could validate that yes, origin A in content process 1 is allowed to mint another Client for origin A in the same content process. - We can then use the client id's more directly in other APIs and provide helpers to enforce a match between content process and client id.
Blocks: 1492223
Blocks: 1494447
Blocks: 1494457
Blocks: 1494458
Blocks: 1494459
Blocks: 1495835
Blocks: 1167039
Blocks: 1495887
Blocks: 1499868
Blocks: 1500513
Blocks: 1500586
Priority: -- → P3
Summary: Create Authoritative 'This Origin to this Content Process' Infratructure → [meta] Create Authoritative 'This Origin to this Content Process' Infratructure
Component: General → DOM: Content Processes
Keywords: meta
Summary: [meta] Create Authoritative 'This Origin to this Content Process' Infratructure → Create Authoritative 'This Origin to this Content Process' Infratructure
Unless this needs a lot of patches/bugs to land, I don't think this is meta. It just blocks a lot of work.
Blocks: 1500953
Blocks: 1501010
Blocks: 1501072
Blocks: 1501082
Summary: Create Authoritative 'This Origin to this Content Process' Infratructure → Create Authoritative 'This Origin to this Content Process' Infrastructure
Blocks: 1501156
Blocks: 1513003
Blocks: 1513680
See Also: → 1432825
Fission Milestone: --- → Future

This bug is not a Fission MVP blocker.

See Also: → 1472158
Keywords: sec-want
Blocks: 1764731
See Also: → 1713203
See Also: → CVE-2024-0748
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.