Libxml2 Xmlsoft Libxml2

Don't miss out!

Thousands of developers use stack.watch to stay informed.
Get an email whenever new security vulnerabilities are reported in Xmlsoft Libxml2.

By the Year

In 2026 there have been 0 vulnerabilities in Xmlsoft Libxml2. Last year, in 2025 Libxml2 had 7 security vulnerabilities published. Right now, Libxml2 is on track to have less security vulnerabilities in 2026 than it did last year.




Year Vulnerabilities Average Score
2026 0 0.00
2025 7 5.37
2024 1 7.50
2023 5 6.93
2022 5 7.33
2021 4 7.45
2020 3 7.17
2019 1 7.50
2018 7 6.80

It may take a day or so for new Libxml2 vulnerabilities to show up in the stats or in the list of recent security vulnerabilities. Additionally vulnerabilities may be tagged under a different product or component name.

Recent Xmlsoft Libxml2 Security Vulnerabilities

xmllint CLI Buffer Overflow via Oversized Input in Interactive Shell
CVE-2025-6170 2.5 - Low - June 16, 2025

A flaw was found in the interactive shell of the xmllint command-line tool, used for parsing XML files. When a user inputs an overly long command, the program does not check the input size properly, which can cause it to crash. This issue might allow attackers to run harmful code in rare configurations without modern protections.

Stack Overflow

libxml2 <2.13.8/2.14.2: heap under-read in xmlSchemaIDCFillNodeTables
CVE-2025-32415 2.9 - Low - April 17, 2025

In libxml2 before 2.13.8 and 2.14.x before 2.14.2, xmlSchemaIDCFillNodeTables in xmlschemas.c has a heap-based buffer under-read. To exploit this, a crafted XML document must be validated against an XML schema with certain identity constraints, or a crafted XML schema must be used.

Improper Validation of Specified Quantity in Input

OOB Mem Access in libxml2 Python API before 2.13.8 & 2.14.2
CVE-2025-32414 5.6 - Medium - April 08, 2025

In libxml2 before 2.13.8 and 2.14.x before 2.14.2, out-of-bounds memory access can occur in the Python API (Python bindings) because of an incorrect return value. This occurs in xmlPythonFileRead and xmlPythonFileReadRaw because of a difference between bytes and characters.

Return of Wrong Status Code

Stack Buffer Overflow in libxml2 (xmlSnprintfElements) before 2.13.6
CVE-2025-24928 7.8 - High - February 18, 2025

libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a stack-based buffer overflow in xmlSnprintfElements in valid.c. To exploit this, DTD validation must occur for an untrusted document or untrusted DTD. NOTE: this is similar to CVE-2017-9047.

Stack Overflow

libxml2 NULL Ptr Dref in xmlPatMatch (pre 2.12.10, 2.13.x < 2.13.6)
CVE-2025-27113 2.9 - Low - February 18, 2025

libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a NULL pointer dereference in xmlPatMatch in pattern.c.

NULL Pointer Dereference

UAF in libxml2 2.12.x (<2.12.10) & 2.13.x (<2.13.6) xmlSchemaIDCFillNodeTables
CVE-2024-56171 7.8 - High - February 18, 2025

libxml2 before 2.12.10 and 2.13.x before 2.13.6 has a use-after-free in xmlSchemaIDCFillNodeTables and xmlSchemaBubbleIDCNodeTables in xmlschemas.c. To exploit this, a crafted XML document must be validated against an XML schema with certain identity constraints, or a crafted XML schema must be used.

Dangling pointer

libxml2 <2.11 UA-Free via xmlXIncludeAddNode
CVE-2022-49043 8.1 - High - January 26, 2025

xmlXIncludeAddNode in xinclude.c in libxml2 before 2.11.0 has a use-after-free.

Dangling pointer

libxml2 UAF CVE-2024-25062 (before 2.12.5)
CVE-2024-25062 7.5 - High - February 04, 2024

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.

Dangling pointer

Heap Buffer Overflow in libxml2 xmlregexp.c Leads to Local Priv Escalation
CVE-2023-40128 7.8 - High - October 27, 2023

In several functions of xmlregexp.c, there is a possible out of bounds write due to a heap buffer overflow. This could lead to local escalation of privilege with no additional execution privileges needed. User interaction is not needed for exploitation.

Memory Corruption

libxml2 <2.11.5 UAF in xmlUnlinkNode
CVE-2023-45322 - October 06, 2023

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. NOTE: the vendor's position is "I don't think these issues are critical enough to warrant a CVE ID ... because an attacker typically can't control when memory allocations fail."

OOB Read in Libxml2 2.11.0 via xmlSAX2StartElement causing DoS
CVE-2023-39615 - August 29, 2023

Xmlsoft Libxml2 v2.11.0 was discovered to contain an out-of-bounds read via the xmlSAX2StartElement() function at /libxml2/SAX2.c. This vulnerability allows attackers to cause a Denial of Service (DoS) via supplying a crafted XML file. NOTE: the vendor's position is that the product does not support the legacy SAX1 interface with custom callbacks; there is a crash even without crafted input.

libxml2 <2.10.4 NULL pointer deref in xmlSchemaFixupComplexType
CVE-2023-28484 6.5 - Medium - April 24, 2023

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.

NULL Pointer Dereference

CVE-2023-29469 libxml2 <2.10.4 xmlDictComputeFastKey hash bug (double free)
CVE-2023-29469 6.5 - Medium - April 24, 2023

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 behavior 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).

Double-free

libxml2 < 2.10.3: Hash Collision & Double-Free via Malformed XML Entity
CVE-2022-40304 7.8 - High - November 23, 2022

An issue was discovered in libxml2 before 2.10.3. Certain invalid XML entity definitions can corrupt a hash table key, potentially leading to subsequent logic errors. In one case, a double-free can be provoked.

Double-free

libxml2 <2.10.3 Integer Overflow with XML_PARSE_HUGE
CVE-2022-40303 7.5 - High - November 23, 2022

An issue was discovered in libxml2 before 2.10.3. When parsing a multi-gigabyte XML document with the XML_PARSE_HUGE parser option enabled, several integer counters can overflow. This results in an attempt to access an array at a negative 2GB offset, typically leading to a segmentation fault.

Integer Overflow or Wraparound

CVE-2016-3709: Possible XSS in libxml2 (XML parser)
CVE-2016-3709 - July 28, 2022

Possible cross-site scripting vulnerability in libxml after commit 960f0e2.

XSS

In libxml2 before 2.9.14, several buffer handling functions in buf.c (xmlBuf*) and tree.c (xmlBuffer*) don't check for integer overflows
CVE-2022-29824 6.5 - Medium - May 03, 2022

In libxml2 before 2.9.14, several buffer handling functions in buf.c (xmlBuf*) and tree.c (xmlBuffer*) don't check for integer overflows. This 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, for example libxslt through 1.1.35, is affected as well.

Integer Overflow or Wraparound

valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes.
CVE-2022-23308 7.5 - High - February 26, 2022

valid.c in libxml2 before 2.9.13 has a use-after-free of ID and IDREF attributes.

Dangling pointer

A flaw was found in libxml2
CVE-2021-3541 6.5 - Medium - July 09, 2021

A flaw was found in libxml2. Exponential entity expansion attack its possible bypassing all existing protection mechanisms and leading to denial of service.

XEE

There is a flaw in the xml entity encoding functionality of libxml2 in versions before 2.9.11
CVE-2021-3517 8.6 - High - May 19, 2021

There is a flaw in the xml entity encoding functionality of libxml2 in versions before 2.9.11. An attacker who is able to supply a crafted file to be processed by an application linked with the affected functionality of libxml2 could trigger an out-of-bounds read. The most likely impact of this flaw is to application availability, with some potential impact to confidentiality and integrity if an attacker is able to use memory information to further exploit the application.

Memory Corruption

There's a flaw in libxml2 in versions before 2.9.11
CVE-2021-3518 8.8 - High - May 18, 2021

There's a flaw in libxml2 in versions before 2.9.11. An attacker who is able to submit a crafted file to be processed by an application linked with libxml2 could trigger a use-after-free. The greatest impact from this flaw is to confidentiality, integrity, and availability.

Dangling pointer

A vulnerability found in libxml2 in versions before 2.9.11 shows
CVE-2021-3537 5.9 - Medium - May 14, 2021

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.

NULL Pointer Dereference

GNOME project libxml2 v2.9.10 has a global buffer over-read vulnerability in xmlEncodeEntitiesInternal at libxml2/entities.c
CVE-2020-24977 6.5 - Medium - September 04, 2020

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.

Out-of-bounds Read

xmlSchemaPreRun in xmlschemas.c in libxml2 2.9.10
CVE-2019-20388 7.5 - High - January 21, 2020

xmlSchemaPreRun in xmlschemas.c in libxml2 2.9.10 allows an xmlSchemaValidateStream memory leak.

Memory Leak

xmlStringLenDecodeEntities in parser.c in libxml2 2.9.10 has an infinite loop in a certain end-of-file situation.
CVE-2020-7595 7.5 - High - January 21, 2020

xmlStringLenDecodeEntities in parser.c in libxml2 2.9.10 has an infinite loop in a certain end-of-file situation.

Infinite Loop

xmlParseBalancedChunkMemoryRecover in parser.c in libxml2 before 2.9.10 has a memory leak related to newDoc->oldNs.
CVE-2019-19956 7.5 - High - December 24, 2019

xmlParseBalancedChunkMemoryRecover in parser.c in libxml2 before 2.9.10 has a memory leak related to newDoc->oldNs.

Missing Release of Resource after Effective Lifetime

libxml2 2.9.8, if --with-lzma is used, allows remote attackers to cause a denial of service (infinite loop) via a crafted XML file
CVE-2018-14567 6.5 - Medium - August 16, 2018

libxml2 2.9.8, if --with-lzma is used, allows remote attackers to cause a denial of service (infinite loop) via a crafted XML file that triggers LZMA_MEMLIMIT_ERROR, as demonstrated by xmllint, a different vulnerability than CVE-2015-8035 and CVE-2018-9251.

Infinite Loop

libxml2, as used in Red Hat JBoss Core Services and when in recovery mode
CVE-2016-9596 6.5 - Medium - August 16, 2018

libxml2, as used in Red Hat JBoss Core Services and when in recovery mode, allows context-dependent attackers to cause a denial of service (stack consumption) via a crafted XML document. NOTE: this vulnerability exists because of an incorrect fix for CVE-2016-3627.

Resource Exhaustion

It was found that Red Hat JBoss Core Services erratum RHSA-2016:2957 for CVE-2016-3705 did not actually include the fix for the issue found in libxml2
CVE-2016-9597 7.5 - High - July 30, 2018

It was found that Red Hat JBoss Core Services erratum RHSA-2016:2957 for CVE-2016-3705 did not actually include the fix for the issue found in libxml2, making it vulnerable to a Denial of Service attack due to a Stack Overflow. This is a regression CVE for the same issue as CVE-2016-3705.

Stack Exhaustion

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
CVE-2018-14404 6.5 - Medium - July 19, 2018

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.

NULL Pointer Dereference

The xz_head function in xzlib.c in libxml2 before 2.9.6
CVE-2017-18258 6.5 - Medium - April 08, 2018

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.

Allocation of Resources Without Limits or Throttling

The xz_decomp function in xzlib.c in libxml2 2.9.8, if --with-lzma is used, allows remote attackers to cause a denial of service (infinite loop) via a crafted XML file
CVE-2018-9251 5.3 - Medium - April 04, 2018

The xz_decomp function in xzlib.c in libxml2 2.9.8, if --with-lzma is used, allows remote attackers to cause a denial of service (infinite loop) via a crafted XML file that triggers LZMA_MEMLIMIT_ERROR, as demonstrated by xmllint, a different vulnerability than CVE-2015-8035.

Infinite Loop

An integer overflow in xmlmemory.c in libxml2 before 2.9.5, as used in Google Chrome prior to 62.0.3202.62 and other products
CVE-2017-5130 8.8 - High - February 07, 2018

An integer overflow in xmlmemory.c in libxml2 before 2.9.5, as used in Google Chrome prior to 62.0.3202.62 and other products, allowed a remote attacker to potentially exploit heap corruption via a crafted XML file.

Integer Overflow or Wraparound

parser.c in libxml2 before 2.9.5 does not prevent infinite recursion in parameter entities.
CVE-2017-16932 7.5 - High - November 23, 2017

parser.c in libxml2 before 2.9.5 does not prevent infinite recursion in parameter entities.

Infinite Loop

parser.c in libxml2 before 2.9.5 mishandles parameter-entity references
CVE-2017-16931 9.8 - Critical - November 23, 2017

parser.c in libxml2 before 2.9.5 mishandles parameter-entity references because the NEXTL macro calls the xmlParserHandlePEReference function in the case of a '%' character in a DTD name.

Buffer Overflow

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a stack-based buffer overflow
CVE-2017-9048 7.5 - High - May 18, 2017

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a stack-based buffer overflow. The function xmlSnprintfElementContent in valid.c is supposed to recursively dump the element content definition into a char buffer 'buf' of size 'size'. At the end of the routine, the function may strcat two more characters without checking whether the current strlen(buf) + 2 < size. This vulnerability causes programs that use libxml2, such as PHP, to crash.

Buffer Overflow

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a heap-based buffer over-read in the xmlDictAddString function in dict.c
CVE-2017-9050 7.5 - High - May 18, 2017

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a heap-based buffer over-read in the xmlDictAddString function in dict.c. This vulnerability causes programs that use libxml2, such as PHP, to crash. This vulnerability exists because of an incomplete fix for CVE-2016-1839.

Heap-based Buffer Overflow

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a heap-based buffer over-read in the xmlDictComputeFastKey function in dict.c
CVE-2017-9049 7.5 - High - May 18, 2017

libxml2 20904-GITv2.9.4-16-g0741801 is vulnerable to a heap-based buffer over-read in the xmlDictComputeFastKey function in dict.c. This vulnerability causes programs that use libxml2, such as PHP, to crash. This vulnerability exists because of an incomplete fix for libxml2 Bug 759398.

Out-of-bounds Read

A buffer overflow was discovered in libxml2 20904-GITv2.9.4-16-g0741801
CVE-2017-9047 7.5 - High - May 18, 2017

A buffer overflow was discovered in libxml2 20904-GITv2.9.4-16-g0741801. The function xmlSnprintfElementContent in valid.c is supposed to recursively dump the element content definition into a char buffer 'buf' of size 'size'. The variable len is assigned strlen(buf). If the content->type is XML_ELEMENT_CONTENT_ELEMENT, then (i) the content->prefix is appended to buf (if it actually fits) whereupon (ii) content->name is written to the buffer. However, the check for whether the content->name actually fits also uses 'len' rather than the updated buffer length strlen(buf). This allows us to write about "size" many bytes beyond the allocated memory. This vulnerability causes programs that use libxml2, such as PHP, to crash.

Buffer Overflow

The htmlParseTryOrFinish function in HTMLparser.c in libxml2 2.9.4
CVE-2017-8872 9.1 - Critical - May 10, 2017

The htmlParseTryOrFinish function in HTMLparser.c in libxml2 2.9.4 allows attackers to cause a denial of service (buffer over-read) or information disclosure.

Out-of-bounds Read

libxml2 2.9.4, when used in recover mode
CVE-2017-5969 4.7 - Medium - April 11, 2017

libxml2 2.9.4, when used in recover mode, allows remote attackers to cause a denial of service (NULL pointer dereference) via a crafted XML document. NOTE: The maintainer states "I would disagree of a CVE with the Recover parsing option which should only be used for manual recovery at least for XML parser.

NULL Pointer Dereference

The xmlBufAttrSerializeTxtContent function in xmlsave.c in libxml2
CVE-2016-4483 7.5 - High - April 11, 2017

The xmlBufAttrSerializeTxtContent function in xmlsave.c in libxml2 allows context-dependent attackers to cause a denial of service (out-of-bounds read and application crash) via a non-UTF-8 attribute value, related to serialization. NOTE: this vulnerability may be a duplicate of CVE-2016-3627.

Marshaling, Unmarshaling

The xmlParseElementDecl function in parser.c in libxml2 before 2.9.4
CVE-2016-4447 7.5 - High - June 09, 2016

The xmlParseElementDecl function in parser.c in libxml2 before 2.9.4 allows context-dependent attackers to cause a denial of service (heap-based buffer underread and application crash) via a crafted file, involving xmlParseName.

Buffer Overflow

Format string vulnerability in libxml2 before 2.9.4
CVE-2016-4448 9.8 - Critical - June 09, 2016

Format string vulnerability in libxml2 before 2.9.4 allows attackers to have unspecified impact via format string specifiers in unknown vectors.

Use of Externally-Controlled Format String

The (1) xmlParserEntityCheck and (2) xmlParseAttValueComplex functions in parser.c in libxml2 2.9.3 do not properly keep track of the recursion depth, which
CVE-2016-3705 7.5 - High - May 17, 2016

The (1) xmlParserEntityCheck and (2) xmlParseAttValueComplex functions in parser.c in libxml2 2.9.3 do not properly keep track of the recursion depth, which allows context-dependent attackers to cause a denial of service (stack consumption and application crash) via a crafted XML document containing a large number of nested entity references.

Improper Input Validation

The xmlStringGetNodeList function in tree.c in libxml2 2.9.3 and earlier, when used in recovery mode
CVE-2016-3627 7.5 - High - May 17, 2016

The xmlStringGetNodeList function in tree.c in libxml2 2.9.3 and earlier, when used in recovery mode, allows context-dependent attackers to cause a denial of service (infinite recursion, stack consumption, and application crash) via a crafted XML document.

Stack Exhaustion

dict.c in libxml2 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash)
CVE-2015-8806 7.5 - High - April 13, 2016

dict.c in libxml2 allows remote attackers to cause a denial of service (heap-based buffer over-read and application crash) via an unexpected character immediately after the "<!DOCTYPE html" substring in a crafted HTML document.

Heap-based buffer overflow in the xmlGROW function in parser.c in libxml2 before 2.9.3
CVE-2015-7499 - December 15, 2015

Heap-based buffer overflow in the xmlGROW function in parser.c in libxml2 before 2.9.3 allows context-dependent attackers to obtain sensitive process memory information via unspecified vectors.

Buffer Overflow

Heap-based buffer overflow in the xmlDictComputeFastQKey function in dict.c in libxml2 before 2.9.3
CVE-2015-7497 - December 15, 2015

Heap-based buffer overflow in the xmlDictComputeFastQKey function in dict.c in libxml2 before 2.9.3 allows context-dependent attackers to cause a denial of service via unspecified vectors.

Buffer Overflow

Heap-based buffer overflow in the xmlParseXmlDecl function in parser.c in libxml2 before 2.9.3
CVE-2015-7498 - December 15, 2015

Heap-based buffer overflow in the xmlParseXmlDecl function in parser.c in libxml2 before 2.9.3 allows context-dependent attackers to cause a denial of service via unspecified vectors related to extracting errors after an encoding conversion failure.

Buffer Overflow

Stay on top of Security Vulnerabilities

Want an email whenever new vulnerabilities are published for Xmlsoft Libxml2 or by Xmlsoft? Click the Watch button to subscribe.

Xmlsoft
Vendor

subscribe