Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.
This repository was archived by the owner on May 9, 2022. It is now read-only.

Cross-Origin Protection #892

@jsharkey13

Description

@jsharkey13

After adding logging of Referer and Origin headers, it is already clear that many browsers do not add Origin headers to same-origin POST requests.

The original authors of the RFC that led to the header suggest that Origin headers which are missing or null, or on an allowed whitelist, should be treated as acceptable; but that requests with a mismatched Origin should be blocked. This affords users with a modern safe browser that does send the headers properly a better degree of protection from CSRF and XSS attacks. We should respond to requests with invalid origins with the CrossSiteRequestForgeryException and a 403 Forbidden.

I don't know if we also want to use the Referer header in cases where the POST has no Origin? And by POST I really mean all state changing requests.

This obviously affords no protection against scripts outside of browsers where headers can be spoofed, but that's not CSRF or XSS.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions