CVE-2021-3518: Use-after-free in xmlXIncludeAddNode XInclude processing
e8f40834-78b0-47f8-8f83-3b78791184ee
A use-after-free vulnerability exists in libxml2's XInclude processing, specifically in the xmlXIncludeAddNode function. When processing XInclude href attributes, the function builds a URI string and frees the intermediate structures. However, the original URI pointer is freed at line 617 before being checked and potentially used in an error message at line 620. If xmlSaveUri fails (returns NULL), the error handler attempts to dereference the freed URI pointer in the error message format string argument, resulting in a use-after-free condition that can cause a crash or memory corruption.",