Skip to content

Conversation

@rosa
Copy link
Member

@rosa rosa commented Jan 5, 2026

In this case requests won't be performed from a secure context and the browser won't send the Sec-Fetch-Site header. This means non-GET requests will be rejected because CSRF protection will fail.

With this change, we allow these requests with missing Sec-Fetch-Site headers if:

  • They happen over HTTP
  • The app is not configured to force SSL

The Origin check always happens in any case.

See #2186

In this case requests won't be performed from a secure context [1] and
the browser won't send the Sec-Fetch-Site header. This means non-GET
requests will be rejected because CSRF protection will fail.

With this change, we allow these requests with missing Sec-Fetch-Site
headers if:
- They happen over HTTP
- The app is not configured to force SSL

The Origin check happens in any case.

[1] https://developer.mozilla.org/en-US/docs/Web/Security/Defenses/Secure_Contexts#potentially_trustworthy_origins
@rosa rosa merged commit 5f390f7 into main Jan 5, 2026
12 checks passed
@rosa rosa deleted the allow-insecure-context-non-ssl-requests branch January 5, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants