DEV Community

Cover image for Angular Security Checklist
Bartosz Pietrucha for Angular

Posted on

Angular Security Checklist

While developing Angular applications we need to pay strong attention to security aspects to prevent, simply speaking from being hacked!

There are many ways we may put our application users in danger and they might be victims of attacks like Cross-site scripting (XSS) or Cross-site request forgery (CSRF). Here is a list of the essential checks you have to perform to raise the level of security of your applications.

πŸ‘‰ Use HttpOnly and Secure cookies,
πŸ‘‰ Sign the cookies and tokens (like JWT) with a strong secret,
πŸ‘‰ Do not store sensitive data in JWT payload,
πŸ‘‰ Ensure your JWT library does not accept alg: none,
πŸ‘‰ Transport all data over HTTPS,
πŸ‘‰ Use Content Security Policy ver. 2,
πŸ‘‰ Do not allow inline scripts (no unsafe-inline),
πŸ‘‰ Use integrity property of all external scripts,
πŸ‘‰ Avoid Angular's bypassSecurityTrust*() methods,
πŸ‘‰ Use CSRF protection with CSRF-Token,
πŸ‘‰ Avoid custom auth library implementation,
πŸ‘‰ Check all API endpoints for role-based authorization,
πŸ‘‰ Use AoT compilation for template checks.

Here you can get a free printable checklist:
⚑ Angular Security Checklist PDF ⚑

Let me know in the comments if you are aware of all the checks and I will be creating more content covering these aspects!

Top comments (1)

Collapse
 
vatsal2210 profile image
Vatsal Shah

How can we verify each point in the current project?