SIMATIC S7-1500 CPU 1518-4 PN/DP MFP: Improper Encoding or Escaping of Output
CVE-2022-25235 is a critical-severity improper encoding or escaping of output vulnerability in SIMATIC S7-1500 CPU 1518-4 PN/DP MFP from Siemens, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version V3.1.5 as the first without the flaw, so updating SIMATIC S7-1500 CPU 1518-4 PN/DP MFP to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 4.96% chance of exploitation within 30 days, which is in the top 7.69% of all scored CVEs.
Critical severity: a successful attack would have severe impact.
What to do
- Update SIMATIC S7-1500 CPU 1518-4 PN/DP MFP to V3.1.5 or a later version.
- Update SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP to V3.1.5 or a later version.
- Update SIPLUS S7-1500 CPU 1518-4 PN/DP MFP to V3.1.5 or a later version.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIPLUS S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Libexpat Project | Libexpat | before 2.4.5 | 2.4.5 |
| Debian | Debian Linux | 10.0; 11.0 | Not stated |
| Fedora Project | Fedora | 34; 35 | Not stated |
| Oracle | HTTP Server | 12.2.1.3.0; 12.2.1.4.0 | Not stated |
| Oracle | Zfs Storage Appliance Kit | 8.8 | Not stated |
| Siemens | Sinema Remote Connect Server | before 3.1 | 3.1 |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.8 | Critical | NVD |
| CVSS 3.1 | 9.8 | Critical | CISA (ADP) |
| CVSS 2.0 | 7.5 | High | NVD |
Official description
xmltok_impl.c in Expat (aka libexpat) before 2.4.5 lacks certain validation of encoding, such as checks for whether a UTF-8 character is valid in a certain context.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Improper Encoding or Escaping of Output
The product prepares a structured message for communication with another component, but encoding or escaping of the data is either missing or done incorrectly. As a result, the intended structure of the message is not preserved.
How developers prevent this class of flaw
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using the ESAPI Encoding control or a similar tool, library, or framework. These will help the programmer encode outputs in a manner less prone to error. Alternately, use built-in functions, but consider using wrappers in case those functions are discovered to have a vulnerability.
- If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated. For example, stored procedures can enforce database query structure and reduce the likelihood of SQL injection.
- Understand the context in which your data will be used and the encoding that will be expected. This is especially important when transmitting data between different components, or when generating outputs that can contain multiple encodings at the same time, such as web pages or multi-part mail messages. Study all expected communication protocols and data representations to determine the required encoding strategies.
More Improper Encoding or Escaping of Output vulnerabilities (CWE-116)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- github.com/libexpat/libexpat/pull/562Third Party Advisory
- oracle.com/security-alerts/cpuapr2022.htmlThird Party Advisory
Third-party and government advisories
- openwall.com/lists/oss-security/2022/02/19/1Mailing List, Third Party Advisory
- cert-portal.siemens.com/productcert/pdf/ssa-484086.pdfThird Party Advisory
- lists.debian.org/debian-lts-announce/2022/03/msg00007.htmlMailing List, Third Party Advisory
- security.gentoo.org/glsa/202209-24Third Party Advisory
- security.netapp.com/advisory/ntap-20220303-0008/Third Party Advisory
- debian.org/security/2022/dsa-5085Third Party Advisory
Other references
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/3UFRBA3UQVIQKXTBUQXD…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Y27XO3JMKAOMQZVPS3B4…
- cert-portal.siemens.com/productcert/html/ssa-398330.html
- cert-portal.siemens.com/productcert/html/ssa-484086.html
Other vulnerabilities in SIMATIC S7-1500 CPU 1518-4 PN/DP MFP
- 9.6 Critical severity
- 9.6 Critical severity
- 9.6 Critical severity
- 7.8 High severity
- 7.1 High severity
- 9.1 Critical severity
Recent Improper Encoding or Escaping of Output vulnerabilities
- 6.1 Medium severity
- 9.8 Critical severity
Spotted an error? Tell us.