News for hackers. Stuff that matters.
Re:API with NestJS #3. Authenticating users with bcrypt, Pas... by poxrud on Monday May 25, 2020 @04:22PM (#23304548)
Because then you can be vulnerable to csrf attack. For example if someone tricks you into clicking www.mysite.com/api/delete-account
Re:API with NestJS #3. Authenticating users with bcrypt, Pas... by anaxag0ras on Monday May 25, 2020 @04:36PM (#23304698)
CSRF attacks can be prevented using same-site policy with cookies.
Re:API with NestJS #3. Authenticating users with bcrypt, Pas... by poxrud on Monday May 25, 2020 @05:19PM (#23305095)
That is true but it will not protect against all forms of CSRF, for example you'll be vulnerable if you have user generated content that's not sanitized properly. On the refresh_token cookie I have sameSite and httpOnly set.