Skip to content
Heist/ feed
Back to feed
HighFix available

libxml2 — security advisory

Type: advisorySources: OSVAdvisory ID: DEBIAN-CVE-2017-9047

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.

Products
libxml2
Affected versions
Not specified
Fixed versions
2.9.4+dfsg1-3.1
CVEs
CVE-2017-9047
Confirmed fixed CVEs
Not specified
Updated in this feed
30 Oct 2026, 14:22 UTC · Revision 1

Source evidence

DEBIAN-CVE-2017-9047

core-osv · Original source

Published 18 May 2017, 06:29 UTC

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.

osv:DEBIAN-CVE-2017-9047

libxml2

Fixed versions: 2.9.4+dfsg1-3.1

libxml2

Fixed versions: 2.9.4+dfsg1-3.1

libxml2

Fixed versions: 2.9.4+dfsg1-3.1

Complete source record
{
  "id": "9603e6e21257d0b026dcbec12185a448334715b38e334583600cd27e9a0e83cc",
  "url": "https://osv.dev/vulnerability/DEBIAN-CVE-2017-9047",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "DEBIAN-CVE-2017-9047",
    "summary": "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.",
    "evidence": "osv:DEBIAN-CVE-2017-9047",
    "products": [
      {
        "name": {
          "value": "libxml2",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.9.4+dfsg1-3.1",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "libxml2",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.9.4+dfsg1-3.1",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      },
      {
        "name": {
          "value": "libxml2",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "2.9.4+dfsg1-3.1",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "high",
    "structured": {
      "id": "DEBIAN-CVE-2017-9047",
      "aliases": [
        "DEBIAN-CVE-2017-9047"
      ],
      "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": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.9.4+dfsg1-3.1"
                }
              ]
            }
          ],
          "package": {
            "name": "libxml2",
            "purl": "pkg:deb/debian/libxml2?arch=source&distro=bookworm",
            "ecosystem": "Debian:12"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2017-9047.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.9.4+dfsg1-3.1"
                }
              ]
            }
          ],
          "package": {
            "name": "libxml2",
            "purl": "pkg:deb/debian/libxml2?arch=source&distro=trixie",
            "ecosystem": "Debian:13"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2017-9047.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "2.9.4+dfsg1-3.1"
                }
              ]
            }
          ],
          "package": {
            "name": "libxml2",
            "purl": "pkg:deb/debian/libxml2?arch=source&distro=forky",
            "ecosystem": "Debian:14"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/debian-osv/debian-cve-osv/DEBIAN-CVE-2017-9047.json"
          },
          "ecosystem_specific": {
            "urgency": "not yet assigned"
          }
        }
      ],
      "modified": "2026-10-15T07:47:29.473981411Z",
      "provider": "osv",
      "upstream": [
        "CVE-2017-9047"
      ],
      "references": [
        "https://security-tracker.debian.org/tracker/CVE-2017-9047"
      ]
    },
    "related_cves": [
      {
        "value": "CVE-2017-9047",
        "evidence": "/upstream"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 322182,
  "published_at": "2017-05-18T06:29:00.403+00:00"
}