Skip to content

Prevent cross document access via policy #4435

Open

Description

@dtapuska

Consider adding a policy to prevent same origin cross document access.
See: https://github.com/dtapuska/documentaccess as an alternate for issue 2757.

@annevk @bzbarsky

Activity

  1. annevk commented on Mar 19, 2019

    @annevk
    Member

    I like the general idea, but I wonder what boundary we are looking for. E.g., if we want these documents to (potentially) end up in different processes, the isolation needs to be at a different level (the agent cluster key) as otherwise there would still be shared memory between these documents, for instance.

    And as these "window" agent clusters really belong to the browsing context group, this seems like the kind of thing to decide when the browsing context group is created.

  2. dtapuska commented on Mar 19, 2019

    @dtapuska
    ContributorAuthor

    I'm not thinking strictly about enforcing process isolation. More like I want to embed this content and it really doesn't have to interact with my content so let me limit the scope I expose to it. So I don't think it necessarily ties into the agent cluster key.

    ie. having two documents directly scriptable probably isn't widely used and it should be easy to opt out of it.

  3. annevk commented on Mar 20, 2019

    @annevk
    Member

    Unless we also provide the ability for UAs to optionally process-isolate them it's not entirely clear to me it's worth it. Otherwise they can still (accidentally) share memory via SharedArrayBuffer and affect each other's execution flow.

  4. dtapuska commented on Mar 20, 2019

    @dtapuska
    ContributorAuthor

    I think these are good points. I probably want to make the definition of the js bindings dependent on the agent cluster key and then adjust the agent cluster key based on the feature policy. Is that what you were thinking?

  5. annevk commented on Mar 21, 2019

    @annevk
    Member

    Yeah, other things to resolve:

    1. Should this be per-origin or per-document.
    2. Should you be able to enforce this same-site, but cross-origin.
    3. How does this affect further embedded or auxiliary browsing contexts' documents. (If they use the normal key again they would have same-origin access, destroying the encapsulation, which makes me think this needs to be decided at browsing context group creation or per-origin, but there might be further alternatives. I didn't consider this too long.)

    And then depending on the resolutions to those there's more, I suspect.

  6. dtapuska commented on Mar 22, 2019

    @dtapuska
    ContributorAuthor

    Are not all your points addressed how feature policies work? If set on an iframe it is on the container policy, otherwise documents can opt into it via the header.

  7. annevk commented on Mar 23, 2019

    @annevk
    Member

    I don't understand how I'm afraid.

  8. added a commit that references this issue on May 9, 2019
    d22ada2
  9. added a commit that references this issue on Jul 29, 2019
    94b8f7a
  10. added 2 commits that reference this issue on Feb 11, 2020
    3bf6272
    8700908
  11. added a commit that references this issue on Sep 17, 2020
    118ca66
  12. added
    addition/proposal
    topic: agent
    needs implementer interest
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    addition/proposalneeds implementer interesttopic: agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions