Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

samuelmaddock
Copy link
Member

@samuelmaddock samuelmaddock commented Aug 23, 2024

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):

  1. WebFrameMain is set to RFH A
  2. Cross-origin navigation begins
  3. WebFrameMain is swapped to RFH B
  4. Window 'unload' listener is emitted in RFH A, now marked as kPendingDeletion
  5. RFH A sends an IPC during the unload listener
  6. IPC is received with senderFrame pointing to RFH B

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

Release Notes

Notes:

  • Added "pinned" WebFrameMain variant used by IPC's senderFrame to ensure immutability of the sender.
  • Added webFrameMain.fromFrameTreeNodeId(frameTreeNodeId) as a method to get a WebFrameMain instance independent of its process and frame IDs.
  • Fixed webFrameMain.fromId(processId, frameId) returning a WebFrameMain which doesn't match the given parameters in cases where a cross-origin navigation occurred.

@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Aug 23, 2024
@samuelmaddock samuelmaddock added the semver/minor backwards-compatible functionality label Aug 23, 2024
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Aug 30, 2024
@samuelmaddock
Copy link
Member Author

Closing in favor of my other proposal linked in the top post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Morty Proxy This is a proxified and sanitized view of the page, visit original site.