Skip to content

Add Signature to CORS non-wildcard request-header name #1819

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
mnot opened this issue Apr 1, 2025 · 4 comments
Open

Add Signature to CORS non-wildcard request-header name #1819

mnot opened this issue Apr 1, 2025 · 4 comments
Labels
security/privacy There are security or privacy implications security-tracker Group bringing to attention of security, or tracked by the security Group but not needing response. topic: cors topic: http

Comments

@mnot
Copy link
Member

mnot commented Apr 1, 2025

What is the issue with the Fetch Standard?

RFC 9421 defines the Signature header field. One of its use cases is signing requests, effectively acting as a credential.

Because Fetch automatically follows redirects and copies headers from the original request into the redirect request, this means that a signature will be sent cross-origin, exposing its contents to a third party server.

One use case we have for this is authenticating bots (like web crawlers) to sites. If a site can be configured to redirect to another one, this would allow the third party site to impersonate the bot to the original target site.

Adding Signature to CORS non-wildcard request-header name would mitigate this.

/cc @jricher

@annevk annevk added security/privacy There are security or privacy implications topic: http topic: cors security-tracker Group bringing to attention of security, or tracked by the security Group but not needing response. labels Apr 1, 2025
@annevk
Copy link
Member

annevk commented Apr 1, 2025

@ricea @youennf @valenting @mozfreddyb thoughts? On the face of it this seems reasonable to me, but we need to make sure it's web compatible somehow.

@mnot
Copy link
Member Author

mnot commented Apr 1, 2025

Other option would be to allow the caller to append to the list of field names to block.

@mozfreddyb
Copy link
Collaborator

As @annevk says, it looks reasonable, but I am not aware of any usage of the Signature header at all. So take that with a pound of salt.

@jricher
Copy link

jricher commented Apr 1, 2025

Note that you'd also want to add the Signature-Input header to the same list, as they're designed to work together in tandem.

RFC9421 is in use for API protection but I haven't seen it as much browser-side yet. I would personally love to see native support added to fetch() calls (ie, pass in a key and signature parameters and it signs the message with a non-exported key for you).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security/privacy There are security or privacy implications security-tracker Group bringing to attention of security, or tracked by the security Group but not needing response. topic: cors topic: http
Development

No branches or pull requests

4 participants