# CVE-2015-20107: Command injection in n/a

> Attackers can inject shell commands via the mailcap module if applications pass untrusted filenames without validation, leading to code execution.

- **Severity:** High 7.8 (`CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 13 Apr 2022
- **Updated:** 14 Oct 2026
- **Also known as:** ALPINE-CVE-2015-20107, ALSA-2022:7581, ALSA-2022:7592, ALSA-2022:7593, AZL-84293, AZL-9417, CLEANSTART-2026-UC25911, CLSA-2022-1658346144, CLSA-2022-1658346794, CLSA-2022-1658347744, CLSA-2026-1772037700, CLSA-2026-1772038463, CLSA-2026-1772146735, DEBIAN-CVE-2015-20107, GHSA-wvcr-2gc8-63gg, OESA-2022-1653, PSF-2022-1, RHSA-2022:7581, RHSA-2022:7592, RHSA-2022:7593, RLSA-2022:7581, RLSA-2022:7592, RLSA-2022:7593, SUSE-SU-2022:2147-1, SUSE-SU-2022:2166-1, SUSE-SU-2022:2174-1, SUSE-SU-2022:2248-1, SUSE-SU-2022:2249-1, SUSE-SU-2022:2291-1, SUSE-SU-2022:2344-1, SUSE-SU-2022:2357-1, SUSE-SU-2022:2357-2, UBUNTU-CVE-2015-20107, USN-5519-1, openSUSE-SU-2024:12143-1

## What is CVE-2015-20107?

CVE-2015-20107 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 13 Apr 2022. It can only be exploited from the same machine or local network, with no action from the victim.

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

Weakness: CWE-77 (Improper Neutralization of Special Elements used in a Command)

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

It affects 5 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `babel` | AlmaLinux:8 | All versions | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| `python-nose-docs` | AlmaLinux:8 | All versions | 1.3.7-31.module_el8.6.0+2781+fed64c13 |
| `python-psycopg2-doc` | AlmaLinux:8 | All versions | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| `python-psycopg2-doc` | AlmaLinux:8 | All versions | 2.7.5-7.module_el8.6.0+3162+01a09e5a |
| `python-sqlalchemy-doc` | AlmaLinux:8 | All versions | 1.3.2-2.module_el8.6.0+2781+fed64c13 |
| `python2` | AlmaLinux:8 | All versions | 2.7.18-11.module_el8.7.0+3331+6c5bd851.alma |
| `python2-Cython` | AlmaLinux:8 | All versions | 0.28.1-7.module_el8.6.0+2781+fed64c13 |
| `python2-Cython` | AlmaLinux:8 | All versions | 0.28.1-7.module_el8.6.0+3162+01a09e5a |
| `python2-PyMySQL` | AlmaLinux:8 | All versions | 0.8.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-attrs` | AlmaLinux:8 | All versions | 17.4.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-babel` | AlmaLinux:8 | All versions | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| `python2-backports` | AlmaLinux:8 | All versions | 1.0-16.module_el8.6.0+2781+fed64c13 |
| `python2-backports` | AlmaLinux:8 | All versions | 1.0-16.module_el8.6.0+3162+01a09e5a |
| `python2-backports-ssl_match_hostname` | AlmaLinux:8 | All versions | 3.5.0.1-12.module_el8.6.0+2781+fed64c13 |
| `python2-bson` | AlmaLinux:8 | All versions | 3.7.0-1.module_el8.6.0+2781+fed64c13 |
| `python2-bson` | AlmaLinux:8 | All versions | 3.7.0-1.module_el8.6.0+3162+01a09e5a |
| `python2-chardet` | AlmaLinux:8 | All versions | 3.0.4-10.module_el8.6.0+2781+fed64c13 |
| `python2-coverage` | AlmaLinux:8 | All versions | 4.5.1-4.module_el8.6.0+2781+fed64c13 |
| `python2-coverage` | AlmaLinux:8 | All versions | 4.5.1-4.module_el8.6.0+3162+01a09e5a |
| `python2-debug` | AlmaLinux:8 | All versions | 2.7.18-11.module_el8.7.0+3331+6c5bd851.alma |
| `python2-devel` | AlmaLinux:8 | All versions | 2.7.18-11.module_el8.7.0+3331+6c5bd851.alma |
| `python2-dns` | AlmaLinux:8 | All versions | 1.15.0-10.module_el8.6.0+2781+fed64c13 |
| `python2-docs` | AlmaLinux:8 | All versions | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| `python2-docs-info` | AlmaLinux:8 | All versions | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| `python2-docutils` | AlmaLinux:8 | All versions | 0.14-12.module_el8.6.0+2781+fed64c13 |
| `python2-funcsigs` | AlmaLinux:8 | All versions | 1.0.2-13.module_el8.6.0+2781+fed64c13 |
| `python2-idna` | AlmaLinux:8 | All versions | 2.5-7.module_el8.6.0+2781+fed64c13 |
| `python2-ipaddress` | AlmaLinux:8 | All versions | 1.0.18-6.module_el8.6.0+2781+fed64c13 |
| `python2-jinja2` | AlmaLinux:8 | All versions | 2.10-9.module_el8.6.0+2781+fed64c13 |
| `python2-libs` | AlmaLinux:8 | All versions | 2.7.18-11.module_el8.7.0+3331+6c5bd851.alma |
| `python2-lxml` | AlmaLinux:8 | All versions | 4.2.3-6.module_el8.6.0+2781+fed64c13 |
| `python2-lxml` | AlmaLinux:8 | All versions | 4.2.3-6.module_el8.6.0+3162+01a09e5a |
| `python2-markupsafe` | AlmaLinux:8 | All versions | 0.23-19.module_el8.6.0+2781+fed64c13 |
| `python2-markupsafe` | AlmaLinux:8 | All versions | 0.23-19.module_el8.6.0+3162+01a09e5a |
| `python2-mock` | AlmaLinux:8 | All versions | 2.0.0-13.module_el8.6.0+2781+fed64c13 |
| `python2-nose` | AlmaLinux:8 | All versions | 1.3.7-31.module_el8.6.0+2781+fed64c13 |
| `python2-numpy` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+2781+fed64c13 |
| `python2-numpy` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+3162+01a09e5a |
| `python2-numpy-doc` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+2781+fed64c13 |
| `python2-numpy-f2py` | AlmaLinux:8 | All versions | 1:1.14.2-16.module_el8.6.0+2781+fed64c13 |

Products: Fedoraproject Fedora, Netapp Active Iq Unified Manager, Netapp Ontap Select Deploy Administration Utility, Netapp Snapcenter, Python Python.

## How do I fix CVE-2015-20107?

Apply the vendor's patch.

## Is CVE-2015-20107 being exploited?

There is no known exploitation of CVE-2015-20107 in the wild and no public exploit code.

Public exploit code:

- Scan for python installations on macOS, and run CVE-2015-20107.py script to report if patching is needed (github_poc): https://github.com/codeskipper/python-patrol

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2015-20107 and fix it if it is affected.

What it is: CVE-2015-20107 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 13 Apr 2022. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2015-20107 in the wild and no public exploit code.

Affected product: Fedoraproject Fedora. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2015-20107/ (Markdown: https://insights.sbomify.com/CVE-2015-20107/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2015-20107
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2015-20107
- OSV: https://osv.dev/vulnerability/CVE-2015-20107

---
From sbomify Insights: https://insights.sbomify.com/CVE-2015-20107/
Summaries are generated and may contain mistakes; the official description above is the record.
