Skip to content

Fix GH-22060 and GH-22122: pin object/closure in callback dispatch#73

Closed
iliaal wants to merge 1 commit into
PHP-8.4from
fix/gh-22060-22122-uaf-pin-fcc-object
Closed

Fix GH-22060 and GH-22122: pin object/closure in callback dispatch#73
iliaal wants to merge 1 commit into
PHP-8.4from
fix/gh-22060-22122-uaf-pin-fcc-object

Conversation

@iliaal
Copy link
Copy Markdown
Owner

@iliaal iliaal commented May 25, 2026

phpGH-22060 + phpGH-22122 fix for PHP-8.4. Same UAF in two callback-dispatch sites: zend_call_known_fcc and spl_perform_autoload forward the borrowed object/closure into the call frame without addref. 8.4 and 8.5 both need the pair, since SPL autoload still uses zend_call_known_function direct. Master only needs the zend_API change because Zend/zend_autoload.c routes through zend_call_known_fcc.

@iliaal iliaal force-pushed the fix/gh-22060-22122-uaf-pin-fcc-object branch from 01cb8aa to d6ac8ec Compare May 25, 2026 01:22
Pin object and closure across zend_call_known_fcc and
spl_perform_autoload so a callback that releases the borrowed FCC
(autoloader self-unregister, SQLite3 setAuthorizer(null)) doesn't
free $this mid-call. Initialize fcc.closure in
ReflectionFunction::invoke/invokeArgs since the pin reads it.

Fixes phpGH-22060
Fixes phpGH-22122
@iliaal iliaal force-pushed the fix/gh-22060-22122-uaf-pin-fcc-object branch from d6ac8ec to 02a264f Compare May 25, 2026 01:24
@iliaal
Copy link
Copy Markdown
Owner Author

iliaal commented May 26, 2026

Superseded by upstream php#22151.

@iliaal iliaal closed this May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant