Skip to content

Fix GH-25639: UAF in report_class_fetch_error() when the autoloader frees the class name - #25641

Open
lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25639
Open

lazerg wants to merge 1 commit into
php:PHP-8.4from
lazerg:fix/gh-25639

Conversation

@lazerg

@lazerg lazerg commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Fixes GH-25639

When the autoloader frees the variable that holds the class name, zend_lookup_class_ex() drops the last reference to the string, and report_class_fetch_error() then builds the "Class not found" message from freed memory. zend_fetch_class() and zend_fetch_class_with_scope() now hold their own reference to the name until the error is reported.

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