Improper Restriction of Operations within the Bounds of a Memory Buffer
libxml2 versions prior to v2.9.5-rc1 are 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.
CWE-119 - Buffer Overflow
Buffer overflow attacks involve data transit and operations exceeding the restricted memory buffer, thereby corrupting or overwriting data in adjacent memory locations. Such overflow allows the attacker to run arbitrary code or manipulate the existing code to cause privilege escalation, data breach, denial of service, system crash and even complete system compromise. Given that languages such as C and C++ lack default safeguards against overwriting or accessing data in their memory, applications utilizing these languages are most susceptible to buffer overflows attacks.