// For flags

CVE-2017-9047

libxml2: Buffer overflow in function xmlSnprintfElementContent

Severity Score

7.5
*CVSS v3

Exploit Likelihood

*EPSS

Affected Versions

*CPE

Public Exploits

1
*Multiple Sources

Exploited in Wild

-
*KEV

Decision

-
*SSVC
Descriptions

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.

Se detectó un desbordamiento de búfer en libxml2 versión 20904-GITv2.9.4-16-g0741801. La función xmlSnprintfElementContent en el archivo valid.c debe volcar recursivamente la definición del contenido del elemento en un búfer de caracteres 'buf' de tamaño "size". La variable len es asignada strlen (buf). Si el content-)type es XML_ELEMENT_CONTENT_ELEMENT, entonces (i) content-)prefix se agrega a buf (si realmente encaja) con lo cual (ii) content-)name se escribe en el búfer. Sin embargo, la comprobación de si el content-)name realmente se ajusta también usa 'len' en lugar de la longitud de búfer actualizada (buf). Esto nos permite escribir sobre "size" muchos bytes más allá de la memoria asignada. Esta vulnerabilidad causa que los programas que usan libxml2, como PHP, se bloqueen.

*Credits: N/A
CVSS Scores
Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
Attack Vector
Network
Attack Complexity
High
Privileges Required
Low
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High
Attack Vector
Network
Attack Complexity
Low
Authentication
None
Confidentiality
None
Integrity
None
Availability
Partial
* Common Vulnerability Scoring System
SSVC
  • Decision:-
Exploitation
-
Automatable
-
Tech. Impact
-
* Organization's Worst-case Scenario
Timeline
  • 2017-05-18 CVE Reserved
  • 2017-05-18 CVE Published
  • 2023-03-07 EPSS Updated
  • 2024-08-05 CVE Updated
  • 2024-08-05 First Exploit
  • ---------- Exploited in Wild
  • ---------- KEV Due Date
CWE
  • CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
  • CWE-122: Heap-based Buffer Overflow
CAPEC
Affected Vendors, Products, and Versions
Vendor Product Version Other Status
Vendor Product Version Other Status <-- --> Vendor Product Version Other Status
Xmlsoft
Search vendor "Xmlsoft"
Libxml2
Search vendor "Xmlsoft" for product "Libxml2"
2.9.4
Search vendor "Xmlsoft" for product "Libxml2" and version "2.9.4"
-
Affected