google / go-safeweb

Secure-by-default HTTP servers in Go.
Apache License 2.0
853 stars 67 forks source link

Create a XSRF plugin that blocks all state-changing requests #337

Closed empijei closed 2 years ago

empijei commented 2 years ago

This would allow users of the framework to lock-in a stateless setup, and make sure potential state changing requests are not processed without a security review.

We currently have two anti-xsrf strategies: angular (link) and HTML (link).

The idea would be to create a third one, called "xsrfblockall" or something similar that behaves exactly like xsrfhtml but it doesn't create or inject XSRF tokens, it just rejects all state changing requests.

The short summary is: