Skip to content

Events: refuse an http Origin on an https request #769

Done

Description

@JuroOravec

Tighten the Events CSRF origin check in enforce_floor (packages/py/citry/citry/ext/events/csrf.py). It compares the host and port of the Origin header with the request's host, and ignores the scheme.

Proposal: also refuse an http: Origin on a request the adapter reports as https. Do not require the schemes to match in general: behind a proxy that ends TLS, the app sees http while the browser sends an https: origin, and a strict match would refuse every call.

Versioning: this refuses requests 1.0.x accepts, so the changelog must say so. Current browsers already refuse this case through Sec-Fetch-Site, so real browser traffic should not change. Tests should cover WSGI, ASGI and Django, including the proxy case.

🤖 Generated with Claude Code

Activity

  1. added this to the 1.1.0 milestone on Nov 18, 2026
  2. added
    next-sprint
    on Nov 18, 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

    next-sprint

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions