You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Use-after-free of call_user_func() function name via autoloader #22878
I found a use-after-free in zend_is_callable_at_frame(). The function borrows
pointers to the class and method elements of an array callable. Validating the
class can invoke an autoloader, and that autoloader can release the array. PHP
then passes the freed method element to zend_is_callable_check_func().
Both call_user_func() and call_user_func_array() reach the same vulnerable
code, so I have included both entry points in this report.
Each call should resolve TriggerAutoload, dispatch through __callStatic(),
and exit normally. Validation must not access the callable after its storage
has been freed.
Actual behavior
Each reproducer exits with status 139 (SIGSEGV) on an optimized PHP 8.5.8
build. Both results reproduced in 100 of 100 fresh processes on macOS arm64.
The official php:8.5.8-cli-bookworm image also crashed in 100 of 100 fresh
processes for each entry point on Linux x86_64.
PHP Version
Primary tested release:
PHP 8.5.8 (cli) (built: Jul 24 2026 17:30:12) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.5.8, Copyright (c) Zend Technologies
with Zend OPcache v8.5.8, Copyright (c), by Zend Technologies
changed the title [-]Heap use-after-free in array callable validation during autoload[/-][+]Please delete: moved to private security reporting[/+]on Jul 24, 2026
changed the title [-]Please delete: moved to private security reporting[/-][+]Use-after-free of call_user_func() function name via autoloader[/+]on Jul 24, 2026
Issues commonly reported that are not considered security issues include (but are not limited to):
Invocation of specially crafted, malicious code intended to cause memory violations. This commonly includes malicious error handlers, destructors or __toString() functions. PHP does not offer sandboxing, and the execution of untrusted code is always considered unsafe. Such issues are bugs, but not security issues. They may still be reported, though please avoid reporting the known issues.
So, this qualifies as a bug, but not as a security issue.
Activity
[-]Heap use-after-free in array callable validation during autoload[/-][+]Please delete: moved to private security reporting[/+]iluuu1994 commentedon Jul 24, 2026
You don't have to worry, this doesn't qualify anyway. I'll post the details once I'm at the computer.
[-]Please delete: moved to private security reporting[/-][+]Use-after-free of call_user_func() function name via autoloader[/+]iluuu1994 commentedon Jul 24, 2026
For context:
https://github.com/php/php-src/security/policy
So, this qualifies as a bug, but not as a security issue.