Skip to content

Conversation

@patrickod
Copy link
Contributor

@patrickod patrickod commented Apr 22, 2025

Deprecate the use of xsrftokens entirely and replace them with requiring clients to send Sec-Fetch-Site fetch metadata request headers that clarify the relationship between the initating and requested origin.

Add tests for Sec-Golink header behavior which continues to be permitted as a substitute for the new CSRF protection as was for the previous one.

Fixes #160
Fixes #156
Fixes #130

@patrickod patrickod requested a review from willnorris April 22, 2025 18:47
Deprecate the use of xsrftokens entirely and replace them with requiring
clients to send [Sec-Fetch-Site](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site) fetch metadata
request headers that clarify the relationship between the initating and
requested origin.

Add tests for Sec-Golink behavior which continues to be permitted as a
substitute for the new CSRF protection as was for the previous one.

Signed-off-by: Patrick O'Doherty <patrick@tailscale.com>
@patrickod patrickod force-pushed the patrickod/sec-fetch-site branch from 37f8bb1 to 676a032 Compare April 22, 2025 18:47
Copy link
Member

@willnorris willnorris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add Updates #NNN (or probably even Fixes #NNN) for the three open xsrf issues? https://github.com/tailscale/golink/issues?q=is%3Aissue%20state%3Aopen%20xsrf

@patrickod patrickod merged commit a1ce1eb into main Apr 22, 2025
3 of 4 checks passed
@patrickod patrickod deleted the patrickod/sec-fetch-site branch April 22, 2025 19:40
@stepbrobd
Copy link
Contributor

stepbrobd commented Apr 22, 2025

CI for Nix failed

willnorris added a commit that referenced this pull request Apr 23, 2025
As of #177, we are now using Sec-Fetch-Site instead of xsrf tokens.

Updates #178

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
willnorris added a commit that referenced this pull request Apr 23, 2025
As of #177, we are now using Sec-Fetch-Site instead of xsrf tokens.

Updates #178

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
willnorris added a commit that referenced this pull request Apr 23, 2025
As of #177, we are now using Sec-Fetch-Site instead of xsrf tokens.

Updates #178

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
willnorris added a commit that referenced this pull request Apr 25, 2025
Prior to #177, our XSRF tokens were bound to link IDs, with a special
`.new` value used for newly created links. So if a user tried to create
a link that already existed, the XSRF check would fail. After #177, this
now silently allows the user to overwrite the existing link without any
indication that this happened.

This change adds a hidden `update` param to the details edit form that
must be present when updating an existing link.

Updates #177

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
willnorris added a commit that referenced this pull request Apr 25, 2025
Prior to #177, our XSRF tokens were bound to link IDs, with a special
`.new` value used for newly created links. So if a user tried to create
a link that already existed, the XSRF check would fail. After #177, this
now silently allows the user to overwrite the existing link without any
indication that this happened.

This change adds a hidden `update` param to the details edit form that
must be present when updating an existing link.

Updates #177

Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d
Signed-off-by: Will Norris <will@tailscale.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants