[VS-NfD] Make the CSRF origin check fail closed #189
Labels
No Label
area:auth
area:docs
area:export
area:ops
area:storage
area:supply-chain
auth
backend
blocked
collab
deployment
docs
effort:L
effort:M
effort:S
frontend
plugins
qa
vs-nfd
vs-nfd:blocker
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: stwaidele/dorfteich#189
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Plan reference:
20-massnahmenplan.md-> Phase 2ADR: n/a
Effort: S (1 AT)
Depends on: —
Context
A state-changing request that presents neither
OriginnorReferercurrently passes the same-origin check. An assessor reads that as a
fail-open control regardless of whether SameSite cookies happen to cover
the browser case.
Current state
apps/api/src/auth/auth.guard.ts:108–112:assertSameOrigintakesorigin ?? refererand returns early when both are absent. The commentnames the intent (non-browser clients such as curl and supertest;
SameSite cookies as the real defence).
Acceptance criteria
Originand withoutRefererarerejected with
403 csrf_origin_mismatch.clients (PAT/bearer authentication), and cookie-authenticated
requests never benefit from it.
PAT-authenticated mutation without either header -> success;
mismatching origin -> 403 (existing behaviour, kept).
the check weakened.
docs/architecture/security.mdrecords the fail-closed rule.Out of scope
CSRF tokens as a second mechanism — the origin check plus SameSite is the
chosen model.
Delivered by PR #240 (commits
d32c8c3+214e707), merged to main as214e707. CI run 478 green. Closing.