# CVE-2015-20107: In Python (aka CPython) up to 3.10.8, the mailcap module does not add escape characters into commands discovered in the…

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** Yes (see exploit references)
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 2.78% (percentile 87, 2026-11-26)
- **CWE:** CWE-77
- **Published:** 2022-04-13T00:00:00.000Z
- **Modified:** 2026-10-14T07:16:36.580Z

## 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

In Python (aka CPython) up to 3.10.8, the mailcap module does not add escape characters into commands discovered in the system mailcap file. This may allow attackers to inject shell commands into applications that call mailcap.findmatch with untrusted input (if they lack validation of user-provided filenames or arguments). The fix is also back-ported to 3.7, 3.8, 3.9

## 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-2015-20107. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2015-20107.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-2015-20107 being exploited?

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

### How serious is CVE-2015-20107?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2015-20107?

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-2015-20107?

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-2015-20107?

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: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FCIO2W4DUVVMI6L52QCC4TT2B3K5VWHS/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ERYMM2QVDPOJLX4LYXWYIQN5FOIJLDRY/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FIRUTX47BJD2HYJDLMI7JJBVCYFAPKAQ/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/46KWPTI72SSEOF53DOYQBQOCN4QQB2GE/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/ONXSGLASNLGFL57YU6WT6Y5YURSFV43U/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/MYG3EMFR7ZHC46TDNM7SNWO64A3W7EUF/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/Y4E2WBEJ42CGLGDHD6ZXOLZ2W6G3YOVD/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XO2H6CKWLRGTTZCGUQVELW6LUH437Q3O/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/W5664BGZVTA46LQDNTYX5THG6CN4FYJX/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/UIOJUZ5JMEMGSKNISTOVI4PDP36FDL5Y/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/KAY6VBNVEFUXKJF37WFHYXUSRDEK34N3/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/F3LNY2NHM6J22O6Q5ANOE3SZRK3OACKR/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GPCLGZZJPVXFWUWVV5WCD5FNUAFLKBDN/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/5DBVY4YC2P6EPZZ2DROOXHDOWZ4BJFLW/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/HAI2GBC7WKH7J5NH6J2IW5RT3VF2SF5M/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/6QIKVSW3H6W2GQGDE5DTIWLGFNH6KKEW/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/AKGMYDVKI3XNM27B6I6RQ6QV3TVJAUCG/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/57NECACX333A3BBZM2TR2VZ4ZE3UG3SN/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PTTZGLD2YBMMG6U6F5HOTPOGGPBIURMA/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/53TQZFLS6O3FLIMVSXFEEPZSWLDZLBOX/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WXF6MQ74HVIDDSR5AE2UDR24I6D4FEPC/>
- vendor: <https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IFGV7P2PYFBMK32OKHCAC2ZPJQV5AUDF/>
- vendor: <https://security.gentoo.org/glsa/202305-02>
- patch: <https://python-security.readthedocs.io/vuln/mailcap-shell-injection.html>
- exploit: <https://bugs.python.org/issue24778>
- other: <https://github.com/python/cpython/issues/68966>
- other: <https://security.netapp.com/advisory/ntap-20220616-0001/>
- other: <https://lists.debian.org/debian-lts-announce/2023/05/msg00024.html>
- other: <https://lists.debian.org/debian-lts-announce/2023/06/msg00039.html>
- other: <https://lists.debian.org/debian-lts-announce/2024/12/msg00000.html>
- 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-2015-20107>

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