Skip to content

Don't truncate header lengths to 32 bits - #24562

Open
jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-header-len-truncation
Open

jorgsowa wants to merge 1 commit into
php:PHP-8.4from
jorgsowa:fix-header-len-truncation

Conversation

@jorgsowa

Copy link
Copy Markdown
Contributor

setcookie() and the Content-Type branch of sapi_header_op() cast the size_t header length to uint32_t, silently truncating headers of 4 GiB or more.

Follow-up of #24540

@jorgsowa
jorgsowa force-pushed the fix-header-len-truncation branch 2 times, most recently from 2d1c506 to 07525f1 Compare October 22, 2026 17:14
@jorgsowa
jorgsowa changed the base branch from master to PHP-8.4 October 22, 2026 17:14
A Set-Cookie line of 4 GiB or more had its length truncated, so
sapi_header_op() did not check the whole line for new lines and NUL bytes.
@jorgsowa
jorgsowa force-pushed the fix-header-len-truncation branch from 07525f1 to c142cf2 Compare October 22, 2026 18:16
@jorgsowa
jorgsowa marked this pull request as ready for review October 22, 2026 19:29
@jorgsowa
jorgsowa requested a review from bukka as a code owner October 22, 2026 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant