Skip to content

Fix GH-25693: UAF of last response headers read after RSHUTDOWN - #25694

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25693-last-http-headers
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25693-last-http-headers

Conversation

@lazerg

@lazerg lazerg commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

The basic RSHUTDOWN freed BG(last_http_headers) but left the zval pointing at the freed array. A user stream wrapper closed later in shutdown could still call http_get_last_response_headers() and get the dangling array back. Reset it to UNDEF after the dtor, the same way http_clear_last_response_headers() does.

Fixes #25693

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

lgtm

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.

2 participants