Skip to content

Fix GH-16630: UAF in lexer with encoding translation and heredocs #16716

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

Closed
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

@nielsdos nielsdos commented Nov 6, 2024

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.
@nielsdos nielsdos linked an issue Nov 6, 2024 that may be closed by this pull request
@nielsdos nielsdos requested review from iluuu1994 and dstogov November 6, 2024 19:28
@nielsdos
Copy link
Member Author

This bug was hit again by #16791, where this lexer bug causes heap corruption causing issues later down the line.

Copy link
Member

@iluuu1994 iluuu1994 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@nielsdos nielsdos closed this in fc1db70 Nov 18, 2024
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.

UAF in lexer with encoding translation and heredocs
3 participants