levkk / rwf

Comprehensive framework for building web applications in Rust.
MIT License
992 stars 18 forks source link

Fix CSRF protection #41

Closed levkk closed 3 days ago

levkk commented 5 days ago

Current CSRF protection doesn't tie the token to a session, so it can be bypassed. We need to pass the request session context into the template to generate a safe CSRF protection token that can be later validated by middleware against the same session.