# CVE-2017-9047: A buffer overflow was discovered in libxml2 20904-GITv2.9.4-16-g0741801. The function xmlSnprintfElementContent in vali…

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.0, NVD) `CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 3.19% (percentile 89, 2026-11-26)
- **CWE:** CWE-119
- **Published:** 2017-05-18T06:13:00.000Z
- **Modified:** 2026-10-14T07:16:40.757Z

## Who should check

- Anyone running n/a (versions: see the vendor advisory)
- Anyone running Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP \>= V3.1.0, \< V3.1.5
- Anyone running Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP \>= V3.1.0, \< V3.1.5
- Anyone running Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP \>= V3.1.0, \< V3.1.5

## Description

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.

## Affected and fixed versions

- n/a: see vendor advisory (nvd)
- Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP: \>= V3.1.0, \< V3.1.5 (nvd)
- Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP: \>= V3.1.0, \< V3.1.5 (nvd)
- Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP: \>= V3.1.0, \< V3.1.5 (nvd)
- Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP: \>= V3.1.0, \< V3.1.5 (nvd)
- Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP: \>= V3.1.0, \< V3.1.5 (nvd)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2017-9047. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2017-9047.md
Affected: n/a; Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5; Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP >= V3.1.0, < V3.1.5; Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP >= V3.1.0, < V3.1.5; Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP >= V3.1.0, < V3.1.5; Siemens SIPLUS S7-1500 CPU 1…
Fixed in: no fixed version listed yet

Steps:
1. Search this machine and project for n/a, Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP, Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP, Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2017-9047 being exploited?

There is no confirmed exploitation: CVE-2017-9047 is not in the CISA Known Exploited Vulnerabilities catalog. Public exploit code or a proof of concept is available. EPSS estimates a 3.19% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2017-9047?

High: CVSS 7.5 (v3.0, scored by NVD). Remote, no login needed.

### Which versions are affected by CVE-2017-9047?

n/a; Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP \>= V3.1.0, \< V3.1.5; Siemens SIMATIC S7-1500 CPU 1518-4 PN/DP MFP \>= V3.1.0, \< V3.1.5; Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP \>= V3.1.0, \< V3.1.5; Siemens SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP \>= V3.1.0, \< V3.1.5; Siemens SIPLUS S7-1500 CPU 1518-4 PN/DP MFP \>= V3.1.0, \< V3.1.5.

### Is there a fix for CVE-2017-9047?

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2017-9047?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- vendor: <http://www.debian.org/security/2017/dsa-3952>
- vendor: <https://security.gentoo.org/glsa/201711-01>
- exploit: <http://www.openwall.com/lists/oss-security/2017/05/15/1>
- other: <http://www.securityfocus.com/bid/98599>
- other: <https://lists.apache.org/thread.html/rf4c02775860db415b4955778a131c2795223f61cb8c6a450893651e4%40%3Cissues.bookkeeper.apache.org%3E>
- other: <https://lists.apache.org/thread.html/r58af02e294bd07f487e2c64ffc0a29b837db5600e33b6e698b9d696b%40%3Cissues.bookkeeper.apache.org%3E>
- other: <https://cert-portal.siemens.com/productcert/html/ssa-398330.html>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2017-9047>

HTML: <https://flawdb.com/CVE-2017-9047> · JSON: <https://flawdb.com/api/v1/entries/CVE-2017-9047>
