Skip to content

feat: optional CSRF protection for cookie/session-based flows #53

Closed

Description

@ZhuchkaTriplesix

Context

  • CSRF matters for cookie-based sessions and HTML forms using session cookies. Pure JWT-in-Authorization APIs often skip CSRF; OxyRoute should offer an optional building block for mixed or server-rendered apps.
  • See Feature gaps.

Direction

  • Options: double-submit cookie, synchronizer token in form + server store, or integration notes with a session library.
  • Safe defaults: constant-time compare, SameSite cookie guidance, reject missing token on mutating methods when enabled.

Acceptance criteria

  • Document threat model (when CSRF applies / when it does not).
  • Pytest for at least one pattern (e.g. token mismatch → 403).

Research

  • Starlette CSRF middleware patterns; OWASP CSRF Prevention Cheat Sheet.

Activity

  1. added this to the v0.2.0 milestone on Apr 26, 2026
  2. linked a pull request that will close this issueIssue 53 csrf #64on Apr 27, 2026
  3. linked a pull request that will close this issuerelease: v0.2.0 hardening from dev #69on Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions