CVE-2021-3518: Use-after-free in libxml2 XInclude recursive processing
306f442f-de70-418c-8ab5-15269bfec84f
libxml2 v2.9.11 contains a use-after-free vulnerability in XInclude processing. When a document recursively includes itself or creates a reference cycle, the document can be freed in a recursive processing context while the parent context still holds a pointer to it. Subsequent use of this freed pointer causes use-after-free vulnerabilities that could lead to information disclosure or code execution.\n\nThe vulnerability occurs in xmlXIncludeLoadDoc when processing recursive includes. After calling xmlXIncludeRecurseDoc (line 1557), which recursively processes the document's includes, the code attempts to use the document pointer at lines 1564-1565, even though the document may have been freed during recursive processing.