-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UAF when magic_quotes_gpc=1 #17938
Comments
Hi @YuanchengJiang do you have any code to share eventually ? cheers. |
@devnexen I don't think a script should be necessary, since this will error on startup anyway. But I can't reproduce it still. I just get leaks, which are expected for these kind of fatal errors and are harmless. |
Did you 2 test on zts? |
magic_quotes_gpc is removed as of PHP 5.4.0. Are there still remains which affect behavior? I'm seriously baffled. |
Ah I see, this requires both |
It's just a very classical problem, confined to zend_test. zend_alloc module is one of the last things that are destroyed, and zend_test module is destroyed prior to zend_alloc. zend_test globals became freed when zend_test module got destroyed. But the zend_alloc module invokes the free handler in zend_test because zend_test registered a ZendMM custom free handler. So, when zend_test tries to access its globals, it crashes with a UAF. |
I was thinking of something like this (https://gist.github.com/nielsdos/1baba32771af8de0feef64b9602d74f7), except that doesn't fix the issue because now we have a dangling pointer for the main heap because it was already freed on shutdown; so it's all a mess. Furthermore, that INI option is incompatible with |
Description
The following code:
Resulted in this output:
To reproduce:
Commit:
Configurations:
Operating System:
This report is automatically generated by FlowFusion
PHP Version
49d798a
Operating System
No response
The text was updated successfully, but these errors were encountered: