drive: use secret token to authenticate access to file server on localhost

This prevents Mark-of-the-Web bypass attacks in case someone visits the
localhost WebDAV server directly.

Fixes tailscale/corp#19592

Signed-off-by: Percy Wegmann <percy@tailscale.com>
pull/11956/head
Percy Wegmann 6 months ago
parent 541cdd7267
commit 5fa395740a
No known key found for this signature in database
GPG Key ID: 29D8CDEB4C13D48B

@ -48,7 +48,6 @@ func NewFileServer() (*FileServer, error) {
if err != nil { if err != nil {
return nil, fmt.Errorf("listen: %w", err) return nil, fmt.Errorf("listen: %w", err)
} }
// }
secretToken, err := generateSecretToken() secretToken, err := generateSecretToken()
if err != nil { if err != nil {

Loading…
Cancel
Save