Skip to content

ext/fileinfo: fix use after free when streams reconstruct file info - #24181

Open
DanielEScherzer wants to merge 2 commits into
php:PHP-8.6from
DanielEScherzer:fileinfo-magic-uaf
Open

DanielEScherzer wants to merge 2 commits into
php:PHP-8.6from
DanielEScherzer:fileinfo-magic-uaf

Conversation

@DanielEScherzer

Copy link
Copy Markdown
Member

In php_fileinfo_from_path(), add an option to delay retrieving the magic_set until it is needed, after user callbacks are run, by passing in the zval holding the magic, rather than the magic set directly. Additionally, reload local magic variables after calling php_fileinfo_from_path(), since user callbacks may have run.

In `php_fileinfo_from_path()`, add an option to delay retrieving the
`magic_set` until it is needed, after user callbacks are run, by passing in the
`zval` holding the magic, rather than the magic set directly. Additionally,
reload local magic variables after calling `php_fileinfo_from_path()`, since
user callbacks may have run.
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