Skip to content

content_encoding: exact-match the identity transfer-coding token - #22541

Closed
alhudz wants to merge 1 commit into
curl:masterfrom
alhudz:te-identity-exact-match
Closed

alhudz wants to merge 1 commit into
curl:masterfrom
alhudz:te-identity-exact-match

Conversation

@alhudz

@alhudz alhudz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Repro: a response carrying Transfer-Encoding: identityx on a normal (no --tr-encoding) transfer is accepted and the body delivered, instead of being rejected.
Cause: Curl_build_unencoding_stack() matches the unsolicited-coding exception identity with a bare curl_strnequal(name, "identity", 8), a prefix compare, so any token starting with identity slips past the CURLE_BAD_CONTENT_ENCODING that every other non-chunked coding hits. The chunked token just above is already length-checked with namelen == 7.
Fix: require namelen == 8 for the identity match, mirroring the chunked check.
Test 2119.

@github-actions github-actions Bot added the tests label Aug 11, 2026

@bagder bagder 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.

Nice catch!

@bagder bagder closed this in f5378b8 Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants