Security advisory
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2017-9048
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 1 Nov 2026, 06:40 UTC · Revision 1
Source evidence
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.
osv:CVE-2017-9048
Complete source record
{
"id": "6278cf47d90853163d7221a1ce6c408a8059866ef16f07b48118b2c64009c0c5",
"url": "https://osv.dev/vulnerability/CVE-2017-9048",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2017-9048",
"summary": "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.",
"evidence": "osv:CVE-2017-9048",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2017-9048",
"aliases": [
"CVE-2017-9048"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/gnome/libxml2",
"type": "GIT",
"events": [
{
"introduced": "bdec2183f34b37ee89ae1d330c6ad2bb4d76605f"
},
{
"last_affected": "bdec2183f34b37ee89ae1d330c6ad2bb4d76605f"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:xmlsoft:libxml2:2.9.4:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.9.4"
},
{
"last_affected": "2.9.4"
}
],
"source": "CPE_STRING"
}
]
}
}
],
"versions": [
"2.9.4",
"v2.9.4"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9048.json"
}
},
{
"ranges": [
{
"repo": "https://gitlab.gnome.org/gnome/libxml2",
"type": "GIT",
"events": [
{
"introduced": "bdec2183f34b37ee89ae1d330c6ad2bb4d76605f"
},
{
"last_affected": "bdec2183f34b37ee89ae1d330c6ad2bb4d76605f"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:xmlsoft:libxml2:2.9.4:*:*:*:*:*:*:*",
"range": [
{
"introduced": "2.9.4"
},
{
"last_affected": "2.9.4"
}
],
"source": "CPE_STRING"
}
]
}
}
],
"versions": [
"2.9.4",
"v2.9.4"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2017-9048.json"
}
}
],
"modified": "2026-10-24T10:30:42.819708203Z",
"provider": "osv",
"references": [
"https://cert-portal.siemens.com/productcert/html/ssa-398330.html",
"https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E",
"https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E",
"https://security.gentoo.org/glsa/201711-01"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2017-9048",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 435478,
"published_at": "2017-05-18T06:29:00.433+00:00"
}