Skip to content

fastcgi: skip params whose name cannot fit in a record - #8321

Closed
BenMacha wants to merge 1 commit into
caddyserver:masterfrom
BenMacha:fix-fastcgi-long-param-name
Closed

BenMacha wants to merge 1 commit into
caddyserver:masterfrom
BenMacha:fix-fastcgi-long-param-name

Conversation

@BenMacha

@BenMacha BenMacha commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

A name longer than maxWrite-8 bytes made the value truncation length
negative and panicked when slicing; skip such pairs instead, as
oversized values are already silently truncated.

Assistance Disclosure

The bug was found during a code review done with Claude Code (Anthropic), which also drafted the fix and the test. I reviewed the change, can explain every line, and ran go test -race -short on the affected package before opening this PR.

A name longer than maxWrite-8 bytes made the value truncation length
negative and panicked when slicing; skip such pairs instead, as
oversized values are already silently truncated.
@caddy-cla

caddy-cla Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

✅ Contributor License Agreement

All identified contributors have signed the CLA. Thank you!

@steadytao

Copy link
Copy Markdown
Member

Silently dropping a FastCGI parameter forwards a materially different request and may omit security-relevant metadata. An unencodable name must fail request construction rather than forwarding a partial parameter set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants