Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Points to consider #134

Closed
michaelbromley opened this issue Aug 2, 2019 · 1 comment
Closed

Security Points to consider #134

michaelbromley opened this issue Aug 2, 2019 · 1 comment

Comments

@michaelbromley
Copy link
Member

michaelbromley commented Aug 2, 2019

Here is a dump of some notes I took from a security lecture (slides) with points that need research in relation to Vendure:

CSRF mitigation:

  • require non-standard header (do we already do this?). E.g. require 'X-CSRF-TOKEN' header on all requests.
  • SameSite cookie attribute.

XSS mitigation:

  • Attack vector - e.g. reviews in shop, order notes etc.
  • Add CSP (Content Security Policy) header in Admin UI.
  • Does Angular need "unsafe eval" enabled to work with CSP?

Other

@michaelbromley
Copy link
Member Author

I've reviewed the points above and here is the current status:

  • helmet is a good general solution for several attack vectors, and for implementing CSP. It can be added as middleware using VendureConfig. I added a note to this in the deployment docs.
  • XSS protections are particularly strong in Angular, with it's AOT compilation model plus built-in distrust of external data in templates.
  • SameSite is interpreted as lax by modern browsers, which protects against CSRF. It can be further customised using the authOptions.cookieOptions settings.
  • Review of the thread model slide lead me to create this issue: Configurable password policy #863 which can be handled in a future release.
  • The @Allow() decorator does now support access control on property resolvers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant