-
Notifications
You must be signed in to change notification settings - Fork 7.9k
UAF in lexer with encoding translation and heredocs #16630
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
Comments
I tried both NTS and ZTS debug builds. Neither the non-JIT nor JIT example reproduces for me.
Can you share the exact commit you tried this on, the configure options used, and the run options used please? |
sorry forgot to append the config.
|
That still doesn't reproduce anything for me. |
For the segv: <?php
$data3 = <<<CODE
<meta <meta name="keywords" content="php documentation">
<meta name="author" content="name"
<meta name="keywords" content="php documentation"
CODE;
foreach ($array as $html) {
} I just reproduced it in the latest commit. Compile:
Run: Output:
|
This reproduces now, thanks. |
zend_save_lexical_state() can be nested multiple times, for example for the parser initialization and then in the heredoc lexing. The input should not be freed if we restore to the same filtered string.
zend_save_lexical_state() can be nested multiple times, for example for the parser initialization and then in the heredoc lexing. The input should not be freed if we restore to the same filtered string.
* PHP-8.2: Fix GH-16630: UAF in lexer with encoding translation and heredocs
* PHP-8.3: Fix GH-16630: UAF in lexer with encoding translation and heredocs
* PHP-8.4: Fix GH-16630: UAF in lexer with encoding translation and heredocs
Description
The following code:
Resulted in this output:
And JIT 1231:
It can cause segfault:
while it does not segfault in JIT
PHP Version
nightly
Operating System
ubuntu 22.04
The text was updated successfully, but these errors were encountered: