IM
IronMonkey Threat Research

CVE-2017-9047 HIGH

Published: 2017-05-18 | Last Modified: 2026-06-17 | Status: Modified

Description

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.

Additional Descriptions (1)

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.

CVSS Metrics

Base Score: 5.0 (MEDIUM)

AV:N/AC:L/Au:N/C:N/I:N/A:P

Access VectorNETWORK
Access ComplexityLOW
AuthenticationNONE
Confidentiality ImpactNONE
Integrity ImpactNONE
Availability ImpactPARTIAL

Source: [email protected]

Type: Primary

Exploitability Score: 10.0

Impact Score: 2.9

Weaknesses

Source Type Description
[email protected] Primary
en CWE-119

Affected Products

Vendor Product Version Update Type
xmlsoft libxml2 2.9.4 <built-in method update of dict object at 0x7fd34b8d9e00> Application

Affected Configurations

Operator: OR

Vulnerable CPE
Yes cpe:2.3:a:xmlsoft:libxml2:2.9.4:*:*:*:*:*:*:*