Skip to content

fastcgi: fix HTTPoxy vulnerability - #7934

Merged
steadytao merged 7 commits into
caddyserver:masterfrom
bzyy1024:master
Aug 19, 2026
Merged

steadytao merged 7 commits into
caddyserver:masterfrom
bzyy1024:master

Conversation

@bzyy1024

@bzyy1024 bzyy1024 commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Added HTTPoxy mitigation to prevent trusting client-supplied Proxy header for setting HTTP_PROXY environment variable.

The FastCGI transport was passing all HTTP headers to backend applications as environment variables, including the client-controlled Proxy header. This allows attackers to set the HTTP_PROXY environment variable in the backend's environment, hijacking outbound HTTP requests made by backend applications.

Assistance Disclosure:

This contribution was prepared with the assistance of an AI coding assistant (CodeBuddy, powered by Deepseek-V4-Pro) in the following ways:

  • Drafting the test cases for HTTPoxy mitigation (reviewed and verified by the human author)
  • Running gofmt formatting and merging the latest upstream master into the branch

All changes have been reviewed, understood, and tested by the human author (bzyy1024). No code was committed without human verification.

Added HTTPoxy mitigation to prevent trusting client-supplied Proxy header for HTTP_PROXY environment variable.

Signed-off-by: bzyy1024 <972702550@qq.com>
Add test to ensure HTTPoxy vulnerability is mitigated by dropping client-supplied Proxy headers.

Signed-off-by: bzyy1024 <972702550@qq.com>
@bzyy1024

Copy link
Copy Markdown
Contributor Author

Hi @mholt, I've added tests for this PR. Could you please take a look when you have a moment?

@mholt

mholt commented Aug 12, 2026

Copy link
Copy Markdown
Member

Thanks, just need to format the file using gofmt first.

@bzyy1024

Copy link
Copy Markdown
Contributor Author

@mholt Thanks for the quick review! I've run gofmt and pushed the formatted code. Appreciate the guidance on my first contribution.

@steadytao

Copy link
Copy Markdown
Member

Just a quick note that we need an Assistance Disclosure.

@bzyy1024

Copy link
Copy Markdown
Contributor Author

Assistance Disclosure:

This contribution was prepared with the assistance of an AI coding assistant (CodeBuddy, powered by Deepseek-V4-Pro) in the following ways:

  • Drafting the test cases for HTTPoxy mitigation (reviewed and verified by the human author)
  • Running gofmt formatting and merging the latest upstream master into the branch

All changes have been reviewed, understood, and tested by the human author (bzyy1024). No code was committed without human verification.

@steadytao steadytao added the bug 🐞 Something isn't working label Aug 16, 2026
@steadytao steadytao added this to the v2.11.5 milestone Aug 16, 2026

@steadytao steadytao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolves the vulnerability. LGTM. Thank you.

@steadytao

Copy link
Copy Markdown
Member

Will let Matt merge this one as he was the original reviewer.

@bzyy1024

Copy link
Copy Markdown
Contributor Author

Thanks both! Changes are in and all set on my side.
@mholt please merge when convenient.

@steadytao
steadytao merged commit 45ba327 into caddyserver:master Aug 19, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants