Skip to main content

ASGI middleware for protecting against CSRF attacks

Project description

asgi-csrf

PyPI CircleCI License

ASGI middleware for protecting against CSRF attacks

This is a preview release - do not assume that this is robust and secure just yet.

Installation

pip install asgi-csrf

Background

See the OWASP guide to Cross Site Request Forgery (CSRF) and their Cross-Site Request Forgery (CSRF) Prevention Cheat Sheet.

This middleware implements the Double Submit Cookie pattern, where a cookie is set that is then compared to a csrftoken hidden form field or a x-csrftoken HTTP header.

Limitations

  • Brand new. Not extensively tested. Do not trust this yet.
  • Currently only works for application/x-www-form-urlencoded forms, not multipart/form-data forms (with file uploads)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

asgi_csrf-0.2a0-py3-none-any.whl (7.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page