Skip to content
Discussion options

You must be logged in to vote

Root Cause

The CSRF protection middleware was being applied to all /api routes, including the v1 API which uses Bearer token authentication. CSRF protection is designed for browser-based session authentication (cookies), not for API token authentication.

Bearer token authentication is inherently protected against CSRF attacks because:

  1. Tokens are not stored in browser cookies
  2. Tokens must be explicitly added to the Authorization header
  3. Attackers cannot trick a browser into adding a Bearer token to requests

Fix

PR #1191 updates the CSRF middleware to skip protection when a Bearer token is present in the Authorization header.

Once merged, your curl command will work:

curl -H "Authorization:…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Yeraze
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants