Skip to content
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

X-Forwarded-Proto Header Manipulation #270

Open
ahpaleus opened this issue Sep 19, 2023 · 0 comments
Open

X-Forwarded-Proto Header Manipulation #270

ahpaleus opened this issue Sep 19, 2023 · 0 comments
Assignees
Labels

Comments

@ahpaleus
Copy link

Severity: Low

The processing of the X-Forwarded-Proto header results in redirection to the injected protocol. While this scenario may have limited impact, improper handling of such headers could result in unpredictable security risks, such as bypass of security mechanisms or confusion in handling TLS.

GET /portal HTTP/2
Host: portal.caddysecurity.network
X-Forwarded-Proto: evil_protocol
Content-Length: 2
HTTP/2 302 Found
Cache-Control: no-store
Location: evil_protocol://portal.caddysecurity.network:443/login
Pragma: no-cache
Server: Fly/a0b91024 (2023-06-13)
Set-Cookie: AUTHP_SESSION_ID=xyz; Domain=caddysecurity.network; Path=/; Secure; HttpOnly;
Date: Wed, 19 Jul 2023 08:46:00 GMT
Content-Length: 0

To address this issue, do not rely on the X-Forwarded-Proto header. If it is required, validate the value of the X-Forwarded-Proto header against an allowlist of accepted protocols (e.g., HTTP/HTTPS) and reject unexpected values.

More information about our Caddy Security public disclosure:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants