Skip to content

withFrameAncestors flattens repeated response headers (Set-Cookie) #21

Description

@mkotelnikov

apps/session-shell/src/policy.ts's withFrameAncestors rebuilds every relay-made response with new Headers(response.headers), which comma-joins repeated headers. Since the session shell stamps that CSP on everything the relay produces, an app's multiple Set-Cookie headers are merged into one and stop working as separate cookies.

Pre-existing (the old worker did the same), but it now applies to every app response in a session, so the app's cookies are a concrete victim.

Fix: append the CSP without reconstructing the header list, or copy repeated headers with getSetCookie() / an explicit per-name append.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions