Flask: Review HTTP security

Created on 16 May 2017  路  2Comments  路  Source: pallets/flask

We should make sure we're providing good, thorough security defaults, or at least documentation on the available options. Not sure if this fits better as Flask config, Werkzeug middleware, or a separate Flask-HTTP-Security extension.

Overview of HTTP security headers: https://blog.appcanary.com/2017/http-security-headers.html
Django's security options: https://docs.djangoproject.com/en/1.11/topics/security/ (some things, such as CSRF and SQL are handled by other libraries, not Flask)

As a first step, good for beginners, it would be nice to get a writeup here of what's already covered and what's not.

docs good first issue

Most helpful comment

@davidism

  • [x] [Cross-Site Scripting](http://flask.pocoo.org/docs/0.12/security/#cross-site-scripting-xss) (XSS)
  • [x] [Cross-Site Request Forgery](http://flask.pocoo.org/docs/0.12/security/#cross-site-request-forgery-csrf) (CSRF)
  • [x] [JSON Security](http://flask.pocoo.org/docs/0.12/security/#json-security)

  • [x] SSL/HTTPS

  • flask-talisman
  • flask-sslify
  • flask-secure-headers

Security Headers

All 2 comments

Setting HSTS and redirecting HTTP to HTTPS might be interesting, cc @kennethreitz

@davidism

  • [x] [Cross-Site Scripting](http://flask.pocoo.org/docs/0.12/security/#cross-site-scripting-xss) (XSS)
  • [x] [Cross-Site Request Forgery](http://flask.pocoo.org/docs/0.12/security/#cross-site-request-forgery-csrf) (CSRF)
  • [x] [JSON Security](http://flask.pocoo.org/docs/0.12/security/#json-security)

  • [x] SSL/HTTPS

  • flask-talisman
  • flask-sslify
  • flask-secure-headers

Security Headers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rkomorn picture rkomorn  路  3Comments

ghostbod99 picture ghostbod99  路  4Comments

maangulo12 picture maangulo12  路  4Comments

ghost picture ghost  路  3Comments

xliiv picture xliiv  路  3Comments