libxml2 vulnerabilities
82 known CVE vulnerabilities in libxml2, translated and rated.
- CVE-2026-86141Low
In libxml2 before 2.15.4, xmlregexp in xmlRegNewParserCtxt has a NULL pointer dereference after a strdup failure, i.e., it does not calculate a string length after NULL checking.
- CVE-2026-86140High
In libxml2 before 2.15.4, xmlSnprintfElements in valid.c has a strcat stack-based buffer overflow.
- CVE-2026-86139Medium
In libxml2 before 2.15.4, xmlURIEscapeStr in uri.c has an integer overflow.
- CVE-2026-86138Medium
In libxml2 before 2.15.4, xmlDictAddQString in dict.c has an integer overflow leading to a heap-based buffer overflow.
- CVE-2026-86137Low
In libxml2 before version 2.15.4, there is an out-of-bounds read vulnerability in the xmlFAParsePosCharGroup function, related to the NXT macro in xmlregexp.
- CVE-2026-11979High
Multiple stack-based buffer overflows were discovered in the xmlcatalog utility of libxml2 when running in --shell mode. The usershell() function processes user input using fixed-size stack buffers without proper bounds checking. Supplying an overly long input line can overflow internal buffers (command, arg, and argv) during input parsing.
- CVE-2026-6732Medium
A type confusion flaw was found in libxml2 when processing a specially crafted XML Schema Definition (XSD) validated document that includes an internal entity reference. An attacker can exploit this by providing a malicious document, causing the application to crash.
- CVE-2026-1757Medium
A flaw was identified in the interactive shell of the xmllint utility, part of the libxml2 project, where memory allocated for user input is not properly released under certain conditions. When a user submits input consisting only of whitespace, the program skips command execution but fails to free the allocated buffer. Repeating this action causes memory to continuously accumulate. Over time, this can exhaust system memory and terminate the xmllint process, creating a denial-of-service condition on the local system.
- CVE-2026-0992Low
A flaw was found in the libxml2 library where uncontrolled resource consumption occurs when processing XML catalogs with repeated <nextCatalog> elements pointing to the same downstream catalog. A remote attacker can exploit this by supplying crafted catalogs, causing redundant traversal of catalog chains.
- CVE-2026-0990Medium
An uncontrolled recursion vulnerability was found in libxml2's xmlCatalogXMLResolveURI function. It occurs when an XML catalog contains a delegate URI entry that references itself, leading to infinite recursion and call stack exhaustion.
- CVE-2026-0989Low
A flaw was found in the RelaxNG parser of libxml2 related to handling external schema inclusions. The parser does not enforce a limit on inclusion depth when resolving nested <include> directives, which can cause excessive recursion. Specially crafted schemas may lead to stack exhaustion and application crashes.
- CVE-2025-9714Medium
In libxml2 up to and including 2.9.14, XPath evaluation functions (xmlXPathRunEval, xmlXPathCtxtCompile, xmlXPathEvalExpr) reset recursion depth to zero before recursive calls, allowing a local attacker to cause uncontrolled recursion and a stack overflow via crafted expressions.
- CVE-2025-8732Low
A vulnerability was found in libxml2 up to version 2.14.5, involving uncontrolled recursion in the xmlParseSGMLCatalog function of the xmlcatalog component. The attack requires local access and can be triggered with untrusted SGML catalogs.
- CVE-2025-6170Low
A flaw in the interactive shell of the xmllint XML parsing tool causes overly long commands to not be properly size-checked, potentially leading to a crash. In rare configurations without modern protections, arbitrary code execution may be possible.
- CVE-2025-49795High
A NULL pointer dereference vulnerability was found in libxml2 when processing XPath XML expressions. This flaw allows an attacker to craft a malicious XML input to libxml2, leading to a denial of service.
- CVE-2025-6021High
A flaw in libxml2's xmlBuildQName function causes integer overflows in buffer size calculations, leading to a stack-based buffer overflow. This can result in memory corruption or denial of service when processing crafted input.
- CVE-2024-34459High
In xmllint from libxml2 before versions 2.11.8 and 2.12.7, formatting error messages with --htmlout can cause a buffer over-read in xmlHTMLPrintFileContext.
- CVE-2024-25062High
An issue was discovered in libxml2 before 2.11.7 and 2.12.x before 2.12.5. When using the XML Reader interface with DTD validation and XInclude expansion enabled, processing crafted XML documents can lead to an xmlValidatePopElement use-after-free.
- CVE-2023-45322Medium
libxml2 through 2.11.5 has a use-after-free that can only occur after a certain memory allocation fails. This occurs in xmlUnlinkNode in tree.c. The vendor's position is that these issues are not critical enough to warrant a CVE ID because an attacker typically can't control when memory allocations fail.
- CVE-2023-29469Medium
An issue was discovered in libxml2 before 2.10.4. When hashing empty dict strings in a crafted XML document, xmlDictComputeFastKey in dict.c can produce non-deterministic values, leading to various logic and memory errors, such as a double free. This occurs because there is an attempt to use the first byte of an empty string, and any value is possible (not solely the '\0' value).
- CVE-2023-28484Medium
In libxml2 before 2.10.4, parsing of certain invalid XSD schemas can lead to a NULL pointer dereference and subsequently a segfault. This occurs in xmlSchemaFixupComplexType in xmlschemas.c.
- CVE-2022-29824Medium
In libxml2 before 2.9.14, buffer handling functions in buf.c (xmlBuf*) and tree.c (xmlBuffer*) do not check for integer overflows, which can result in out-of-bounds memory writes. Exploitation requires a victim to open a crafted, multi-gigabyte XML file. Other software using libxml2's buffer functions, such as libxslt through 1.1.35, is also affected.
- CVE-2021-3541Medium
A flaw was found in libxml2. Exponential entity expansion attack its possible bypassing all existing protection mechanisms and leading to denial of service.
- CVE-2021-3516High
There's a flaw in libxml2's xmllint in versions before 2.9.11. An attacker who is able to submit a crafted file to be processed by xmllint could trigger a use-after-free. The greatest impact of this flaw is to confidentiality, integrity, and availability.
- CVE-2021-3537Medium
A vulnerability found in libxml2 in versions before 2.9.11 shows that it did not propagate errors while parsing XML mixed content, causing a NULL dereference. If an untrusted XML document was parsed in recovery mode and post-validated, the flaw could be used to crash the application. The highest threat from this vulnerability is to system availability.
- CVE-2020-24977Medium
GNOME project libxml2 v2.9.10 has a global buffer over-read vulnerability in xmlEncodeEntitiesInternal at libxml2/entities.c. The issue has been fixed in commit 50f06b3e.
- CVE-2019-20388High
xmlSchemaPreRun in xmlschemas.c in libxml2 2.9.10 allows an xmlSchemaValidateStream memory leak.
- CVE-2018-14404Medium
A NULL pointer dereference vulnerability exists in the xpath.c:xmlXPathCompOpEval() function of libxml2 through 2.9.8 when parsing an invalid XPath expression in the XPATH_OP_AND or XPATH_OP_OR case. Applications processing untrusted XSL format inputs with the use of the libxml2 library may be vulnerable to a denial of service attack due to a crash of the application.
- CVE-2017-18258Medium
The xz_head function in xzlib.c in libxml2 before 2.9.6 allows remote attackers to cause a denial of service (memory consumption) via a crafted LZMA file, because the decoder functionality does not restrict memory usage to what is required for a legitimate file.
- CVE-2017-0663High
A remote code execution vulnerability in libxml2 could allow an attacker to execute arbitrary code within the context of an unprivileged process. This issue affects applications using this library on Android.
- CVE-2017-9047High
A buffer overflow was discovered in the libxml2 library in the xmlSnprintfElementContent function, which can lead to writing data beyond allocated memory. The issue arises when the buffer length check does not account for the updated length after appending the prefix.
- CVE-2016-9318Medium
libxml2 2.9.4 and earlier, as used in XMLSec 1.2.23 and earlier and other products, does not offer a flag directly indicating that the current document may be read but other files may not be opened, which makes it easier for remote attackers to conduct XML External Entity (XXE) attacks via a crafted document.
Vulnerability data from NVD (NIST) · CISA KEV · EPSS

