FreeBSD VuXML: Documenting security issues in FreeBSD and the FreeBSD Ports Collection

libxml2 -- Multiple Issues

Affected packages
libxml2 <= 2.9.4

Details

VuXML ID 76e59f55-4f7a-4887-bcb0-11604004163a
Discovery 2017-05-10
Entry 2017-12-13

libxml2 developers report:

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.

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.

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.

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.

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.

References

CVE Name CVE-2017-8872
CVE Name CVE-2017-9047
CVE Name CVE-2017-9048
CVE Name CVE-2017-9049
CVE Name CVE-2017-9050
URL http://www.openwall.com/lists/oss-security/2017/05/15/1
URL http://www.openwall.com/lists/oss-security/2017/05/15/1
URL http://www.openwall.com/lists/oss-security/2017/05/15/1
URL http://www.openwall.com/lists/oss-security/2017/05/15/1
URL http://www.securityfocus.com/bid/98556
URL http://www.securityfocus.com/bid/98568
URL http://www.securityfocus.com/bid/98599
URL http://www.securityfocus.com/bid/98601
URL https://bugzilla.gnome.org/show_bug.cgi?id=775200