[Secure-testing-team] Bug#863022: libxml2: CVE-2017-9047: stack overflow in valid.c

Salvatore Bonaccorso carnil at debian.org
Sat May 20 09:33:45 UTC 2017


Source: libxml2
Version: 2.9.4+dfsg1-2.2
Severity: important
Tags: security upstream
Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=781333

Hi,

the following vulnerability was published for libxml2.

CVE-2017-9047[0]:
| 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.

>From [1] this is [2], which is not yet opened. The report at [1]
contains a proposed patch, but which is not yet included upstream.

If you fix the vulnerability please also make sure to include the
CVE (Common Vulnerabilities & Exposures) id in your changelog entry.

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2017-9047
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-9047
[1] http://www.openwall.com/lists/oss-security/2017/05/15/1
[2] https://bugzilla.gnome.org/show_bug.cgi?id=781333

Please adjust the affected versions in the BTS as needed.

Regards,
Salvatore



More information about the Secure-testing-team mailing list