Fix use-after-free with `xmllint --html --push`
Call htmlCtxtUseOptions to make sure that names aren't stored in dictionaries. Note that this issue only affects xmllint using the HTML push parser. Fixes #230.
-
mentioned in issue #235 (closed)
-
@nwellnhof Hi,I recently ran into this issue on a historical version of libxml2 as well and was doing some root cause analysation work. But I don't understand enough about the way html is parsed, so I don't really understand the real cause of this vulnerability. Could please tell me why you patched the vulnerability like this?
-
Author Maintainer
@dhbbb I don't remember the exact details. Reading the commit message, it had something with storing element names in a dictionary. The XML parser does this by default and has an option
XML_PARSE_NODICT
to disable this behavior. The HTML parser never stores element names in dictionaries andhtmlCtxtUseOptions
setsctxt->dictNames
to 0. Anyway, mixinghtml*
andxml*
function calls is obviously wrong.