Skip to content

[FEAT] Add namespaced CSRF token names - #33

Merged
chris-okuda merged 2 commits into
mainfrom
chrisokuda/sc-40567/csrf_namespacing
Sep 1, 2026
Merged

chris-okuda merged 2 commits into
mainfrom
chrisokuda/sc-40567/csrf_namespacing

Conversation

@chris-okuda

@chris-okuda chris-okuda commented Sep 1, 2026 •

Copy link
Copy Markdown
Contributor

Scope of changes

Prevent CSRF cookie collisions between services sharing a host.

  • Add configurable namespace-derived cookie and header names preserving legacy names by default
  • Add NewSecureTokenHandler which defaults to host-only (prefix __HOST-) cookie names
  • Support automatic namespacing through Namespacer
  • Skip CSRF validation for safe HTTP methods GET, HEAD, and OPTIONS
  • Add namespace, collision, validation, and compatibility tests

Fixes SC-40567

Type of change

  • new feature
  • bug fix
  • documentation
  • testing
  • technical debt
  • other (describe)

Acceptance criteria

This PR will be merged without review.

Definition of Done

  • I have manually tested the change running it locally (having rebuilt all containers) or via unit tests
  • I have added unit and/or integration tests that cover my changes
  • I have added new test fixtures as needed to support added tests
  • I have updated the dependencies list if necessary (including updating yarn.lock and/or go.sum)
  • I have documented service configuration changes or created related devops stories

Prevent CSRF cookie collisions between services sharing a host.

- Add configurable namespace-derived cookie and header names
- Preserve legacy names by default
- Support automatic namespacing through `Namespacer`
- Skip CSRF validation for safe HTTP methods `GET`, `HEAD`, and
  `OPTIONS`
- Add namespace, collision, validation, and compatibility tests
@chris-okuda chris-okuda self-assigned this Sep 1, 2026
@chris-okuda
chris-okuda merged commit 0dd7d7a into main Sep 1, 2026
5 checks passed
@chris-okuda
chris-okuda deleted the chrisokuda/sc-40567/csrf_namespacing branch September 1, 2026 01:36
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