Skip to content

fix(security): enhance client ID audit logging and CSRF origin validation#577

Merged
lakhansamani merged 1 commit intomainfrom
fix/client-id-csrf-hardening
Apr 5, 2026
Merged

fix(security): enhance client ID audit logging and CSRF origin validation#577
lakhansamani merged 1 commit intomainfrom
fix/client-id-csrf-hardening

Conversation

@lakhansamani
Copy link
Copy Markdown
Contributor

Summary

  • Client ID logging (MEDIUM): Empty client ID requests now emit debug-level audit log; code documented to explain why empty client ID is allowed (OAuth callbacks, JWKS, health endpoints)
  • CSRF origin validation (MEDIUM): CSRF middleware now validates the Origin header against configured AllowedOrigins using the same validator as CORS middleware, rejecting requests from disallowed origins with 403

Files Changed

  • internal/http_handlers/client_check.go — audit logging + documentation
  • internal/http_handlers/csrf.go — origin validation

Test plan

  • make test-sqlite passes (no regressions)
  • Verify GraphQL requests without client ID still work
  • Verify cross-origin POST requests from disallowed origins are rejected
  • Verify same-origin requests pass CSRF check

@lakhansamani lakhansamani merged commit d1aedfb into main Apr 5, 2026
@lakhansamani lakhansamani deleted the fix/client-id-csrf-hardening branch April 5, 2026 02:00
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.

1 participant