Skip to content

paste: keep an owner handoff from taking over the visitor's identity - #229

Open
cgzones wants to merge 1 commit into
matze:masterfrom
cgzones:owner-handoff
Open

cgzones wants to merge 1 commit into
matze:masterfrom
cgzones:owner-handoff

Conversation

@cgzones

@cgzones cgzones commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

A visitor with no cookie who opened someone else's ?owner= link took that uid as the first entry of their list, and the form insert files new pastes under the first entry. Everything the visitor created afterwards therefore belonged to whoever handed out the link, who could delete it. Mint an own uid before appending the claim, so a claim only ever grants rights over the pastes it came with.

The handoff is also GET-only now. A cross-site POST does not carry the SameSite=Lax uid cookie, so honouring it there let an attacker page auto-submit a hidden form and set a cookie over the visitor's real one, costing them the right to delete everything they had made.

A visitor with no cookie who opened someone else's `?owner=` link took that
uid as the first entry of their list, and the form insert files new pastes
under the first entry. Everything the visitor created afterwards therefore
belonged to whoever handed out the link, who could delete it. Mint an own
uid before appending the claim, so a claim only ever grants rights over the
pastes it came with.

The handoff is also GET-only now. A cross-site POST does not carry the
`SameSite=Lax` uid cookie, so honouring it there let an attacker page
auto-submit a hidden form and set a cookie over the visitor's real one,
costing them the right to delete everything they had made.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant