How to protect web app against login CSRF while also allowing mobile app/curl to access REST API?

I am using Django REST framework.
I want a single API for all of my clients (web, mobile, curl).
I understand that I need to include a CSRF token in requests originating from the web client, to protect against CSRF. However, this is not ne… Continue reading How to protect web app against login CSRF while also allowing mobile app/curl to access REST API?

What is the risk of lenient CORS header for a webapplication that stores tokens in sessionStorage and not in cookies?

Let’s assume we have a web-application that stores its auth token in the browser’s sessionStorage/localStorage and does not use cookies. If I’m not completely mistaken, such a web application is not vulnerable against CSRF attacks, right?
Continue reading What is the risk of lenient CORS header for a webapplication that stores tokens in sessionStorage and not in cookies?

Understanding Cross-Domain Cookies and `SameSite` Attributes with Express.js and Third-Party Tracking

What I have understood (I guess):

Cross-origin Cookies:
Cookies set with Domain="example.com" are not sent with fetch requests from origins like hello.example2.com to mywebsite.example.com because they are different domains. How… Continue reading Understanding Cross-Domain Cookies and `SameSite` Attributes with Express.js and Third-Party Tracking

OAuth 2.0 – why is the state parameter needed in order to prevent CSRF at authorization code login flow?

I’m having a really hard time understanding why the state should be used to protect against CSRF at the OAuth 2.0 login flow.
Imagine I have an Authorization Server with a legitimate client registered with the client_id of my-app-123 and t… Continue reading OAuth 2.0 – why is the state parameter needed in order to prevent CSRF at authorization code login flow?