feat: add pinned WebFrameMain variant #43456
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Note
This proposal has been superseded by #43473
In our security recommendations guide, we list validating senderFrame of IPCs. In the case of IPCs sent after the unload event, it's possible for
senderFrame
to point to a different RenderFrameHost than the sender of the IPC.The process occurs as followed (gist to repro):
kPendingDeletion
WebFrameMain
internally indexes a RFH by its FrameTreeNode ID. This is based on the design of WebFrameMain being similar to how<iframe>
works.By introducing a "pinned" WebFrameMain, we can ensure the data is immutable and won't update in the case of cross-origin navigation frame swaps.
Checklist
npm test
passesRelease Notes
Notes:
senderFrame
to ensure immutability of the sender.webFrameMain.fromFrameTreeNodeId(frameTreeNodeId)
as a method to get a WebFrameMain instance independent of its process and frame IDs.webFrameMain.fromId(processId, frameId)
returning a WebFrameMain which doesn't match the given parameters in cases where a cross-origin navigation occurred.