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 17 vulnerabilities in Xmlsoft Libxml2 with an average score of 5.6 out of ten. Last year, in 2025 Libxml2 had 7 security vulnerabilities published. That is, 10 more vulnerabilities have already been reported in 2026 as compared to last year. However, the average CVE base score of the vulnerabilities in 2026 is greater by 0.20.
| Year | Vulnerabilities | Average Score |
|---|---|---|
| 2026 | 17 | 5.58 |
| 2025 | 7 | 5.37 |
| 2024 | 1 | 7.50 |
| 2023 | 5 | 6.93 |
| 2022 | 5 | 7.60 |
| 2021 | 4 | 8.60 |
| 2020 | 3 | 7.50 |
| 2019 | 1 | 7.50 |
| 2018 | 7 | 6.87 |
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
GNOME libxml2 2.9.10-2.15.4 Use-After-Free in xmlValidatePopElement
CVE-2026-137067
5.8 - Medium
- November 25, 2026
GNOME libxml2 2.9.10 through 2.15.4 contains a use-after-free vulnerability in xmlValidatePopElement because xmlCtxtReset frees the DTD without popping stale validation states. Attackers supplying an XML document ending inside an element to an application reusing a DTD-validating xmlTextReader can trigger heap reads, causing crashes and limited heap disclosure via error messages.
Dangling pointer
libxml2 <=2.15.4 heap UAF in xmlTextReader reuse
CVE-2026-137068
5.7 - Medium
- November 25, 2026
libxml2 through 2.15.4 contains a heap use-after-free vulnerability that allows attackers to crash applications by triggering xmlFreeNode on a stale reader->faketext node after xmlTextReader reuse. Attackers can supply XML containing a namespace declaration to applications that read its value and reuse the reader, causing a freed document's dictionary read and process crash.
Dangling pointer
libxml2 2.13.0-2.15.4 DoS via xmlTextReaderSetup state reuse
CVE-2026-137069
5.7 - Medium
- November 25, 2026
libxml2 2.13.0 through 2.15.4 contains a denial of service vulnerability because xmlTextReaderSetup does not reset reader->state when a reader is reused. Attackers can submit one malformed XML document to an application reusing a single reader, causing every later document to be rejected until the reader is recreated.
Missing Initialization of Resource
libxml2 < 2.15.5 UAF in xmlTextReaderClose (CVE2026137072)
CVE-2026-137072
5.8 - Medium
- November 25, 2026
GNOME libxml2 2.9.10 through 2.15.4 contains a use-after-free vulnerability that allows attackers to trigger stale DTD validation states after xmlTextReaderCurrentDoc documents are freed. Attackers can supply an XML document ending with an error inside an element, causing xmlTextReaderClose to read freed element declarations, leading to crashes and possible invalid frees.
Dangling pointer
GNOME libxml2 2.15.4 Double-Free in xmlReaderNewWalker()
CVE-2026-137073
5.8 - Medium
- November 25, 2026
GNOME libxml2 through 2.15.4 contains a double free vulnerability in xmlReaderNewWalker() that frees reader->input again after xmlTextReaderClose() already released it. Applications reusing a closed xmlTextReader with xmlReaderNewWalker() can crash, and groomed heap memory can control the close callback for possible code execution.
Double-free
GNOME libxml2 2.12.6-2.15.4 NULL ptr deref in xmlTextReaderConstEncoding (DoS)
CVE-2026-137074
5.7 - Medium
- November 25, 2026
GNOME libxml2 2.12.6 through 2.15.4 contains a NULL pointer dereference vulnerability in xmlTextReaderConstEncoding() after a reader is reset with xmlReaderNewWalker(). Because xmlCtxtReset() leaves ctxt->input NULL, querying the document encoding makes xmlGetActualEncoding() read ctxt->input->flags without a check, crashing the application and causing denial of service.
NULL Pointer Dereference
libxml2 <2.15.5 NUL termination bug in xmlBufferAddHead leads to OOB read
CVE-2026-137075
2 - Low
- November 25, 2026
GNOME libxml2 2.14.0 through 2.15.4 contains a missing NUL termination flaw in xmlBufferAddHead() in buf.c that leaves uninitialized heap bytes as the terminator for storage-less buffers. Attackers supplying data to applications reusing an xmlBuffer can trigger over-reads via xmlBufferCat() and xmlStrlen(), disclosing adjacent heap memory or causing crashes.
Improper Null Termination
GNOME libxml2 2.15.4 NULL ptr deref DoS via SAX1 reuse
CVE-2026-137082
5.7 - Medium
- November 25, 2026
GNOME libxml2 through 2.15.4 contains a NULL pointer dereference vulnerability in xmlParseStartTag2() that allows attackers to crash applications by triggering parser context reuse after SAX1 parsing. Attackers can supply documents with attributes parsed first with XML_PARSE_SAX1 and then without it on a reused context, causing writes to unallocated ctxt->attallocs and denial of service.
NULL Pointer Dereference
libxml2 <2.15.4 XInclude parseFlags not propagated XEE/SSRF risk
CVE-2026-86144
5.6 - Medium
- September 05, 2026
In xinclude in libxml2 before 2.15.4, xmlXIncludeProcess and xmlXIncludeProcessTree do not propagate parseFlags. This has security relevance for, for example, the XML_PARSE_NONET flag, if (without it) a custom resource loader accesses the internet and triggers XML external entity injection, SSRF, or a denial of service (e.g., for an attacker-controlled internet resource that is intentionally slow).
Incorrect Resource Transfer Between Spheres
libxml2 2.15.4 xmlIO Int Overflow via Negative Lengths
CVE-2026-86143
6.9 - Medium
- September 05, 2026
In xmlIO in libxml2 before 2.15.4, an inconsistency in xmlOutputWriteCallback and xmlBufUse causes negative lengths to reach write callbacks, aka a lack of a check for integer overflow before calling writecallback. This has security relevance for many types of uses of that length value within a callback.
Integer Coercion Error
Heap-Overflow in libxml2 <2.15.4 xmlXPtrEvalXPtrPart
CVE-2026-86142
6.9 - Medium
- September 05, 2026
In libxml2 before 2.15.4, there is a heap-based buffer overflow in xmlXPtrEvalXPtrPart because of xmlXPtrEval xpointer length saturation.
Heap-based Buffer Overflow
NULL Ptr Deref in xmlRegNewParserCtxt via xmlregexp (libxml2 <2.15.4)
CVE-2026-86141
2.9 - Low
- September 05, 2026
xmlregexp in libxml2 before 2.15.4 has a NULL pointer dereference in xmlRegNewParserCtxt after a strdup failure, i.e., it does not calculate a string length after NULL checking.
Unchecked Return Value
libxml2 <2.15.4 Stack-Based Buffer Overflow in xmlSnprintfElements
CVE-2026-86140
8 - High
- September 05, 2026
In libxml2 before 2.15.4, xmlSnprintfElements in valid.c has a strcat stack-based buffer overflow.
Stack Overflow
libxml2: xmlURIEscapeStr Integer Overflow before 2.15.4
CVE-2026-86139
6.9 - Medium
- September 05, 2026
In libxml2 before 2.15.4, xmlURIEscapeStr in uri.c has an integer overflow.
Integer Overflow or Wraparound
libxml2 < 2.15.4: Integer Overflow in xmlDictAddQString (Heap BOverflow)
CVE-2026-86138
6.9 - Medium
- September 05, 2026
In libxml2 before 2.15.4, xmlDictAddQString in dict.c has an integer overflow and resultant heap-based buffer overflow.
Integer Overflow or Wraparound
libxml2 <2.15.4 OOB Read in xmlFAParsePosCharGroup (xmlregexp NXT macro)
CVE-2026-86137
2.9 - Low
- September 05, 2026
In libxml2 before 2.15.4, xmlFAParsePosCharGroup has an out-of-bounds read, aka an out-of-bounds read in the NXT macro in xmlregexp.
Out-of-bounds Read
Stack Overflow in libxml2 xmlcatalog --shell mode
CVE-2026-11979
- June 29, 2026
libxml2 is vulnerable to multiple stack-based buffer overflows in the xmlcatalog utility when running in --shell mode. The usershell() function processes user input using fixed-size stack buffers without proper bounds checking. By supplying an overly long input line, an attacker can overflow internal buffers (command, arg, and argv) during input parsing. This results in memory corruption within the stack frame. Successful exploitation may cause a crash or potentially allow arbitrary code execution in the context of the xmlcatalog process. This issue has been fixed in the commit c2e233fc. NOTE: The maintainers of this project did not agree that this issue is a vulnerability and considered it a bug.
Stack Overflow
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
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
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
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
- 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.
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
- 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.
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
- 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
- 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
- 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.
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
- 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.
libxml2, as used in Red Hat JBoss Core Services and when in recovery mode
CVE-2016-9596
- 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.
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
- 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
- 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.
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
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.