GNU Bison before 3.7.1 has a use-after-free in _obstack_free in lib/obstack.c (called from gram_lex) when a '\0' byte is encountered. NOTE: there is a risk only if Bison is used with untrusted input, and the observed bug happens to cause unsafe behavior with a specific compiler/architecture. The bug report was intended to show that a crash may occur in Bison itself, not that a crash may occur in code that is generated by Bison.
The product reuses or references memory after it has been freed. At some point afterward, the memory may be allocated again and saved in another pointer, while the original pointer references a location somewhere within the new allocation. Any operations using the original pointer are no longer valid because the memory "belongs" to the code that operates on the new pointer.
Link | Tags |
---|---|
https://github.com/akimd/bison/commit/be95a4fe2951374676efc9454ffee8638faaf68d | third party advisory patch |
https://lists.gnu.org/r/bug-bison/2020-07/msg00051.html | mailing list vendor advisory |
https://github.com/akimd/bison/compare/v3.7...v3.7.1 | third party advisory |