In plain words
Cross-site request forgery happens when a page on another site makes a visitor's browser send a request to your app with their cookies attached, so it acts as them without their knowing.
Where you see it
Harbor signs users in with a session cookie, and an old route changes a project's billing email from a plain form POST. If that cookie were sent on cross-site requests, any website a signed-in customer visited could submit that form in the background.
What goes wrong
- Changing data with a GET
SameSite=Lax still sends cookies when a visitor follows a link from another site, so a GET route like /projects/42/delete can be triggered by a link. Anything that changes data should use POST, PUT, PATCH or DELETE.
- SameSite=None on the session cookie
Setting SameSite=None to make an embed or a cross-site flow work sends the session along with every cross-site request. Keep the session cookie Lax or Strict, and give the cross-site case its own token.
- Counting on CORS to stop it
CORS decides whether another site may read your response, not whether the browser sends the request. A plain form POST still arrives, so check the origin or a CSRF token on the server.
What to tell your agent
Quick check
Sign in to earn +10 XP for itHarbor's session cookie is set with SameSite=None, and its API has strict CORS rules. A malicious page submits a hidden form that POSTs to Harbor's change-email route. What happens if there's no other defence?