CVE-2015-20107: Input Validation
A command injection vulnerability was found in Python 2.x and 3.x, specifically within the mailcap module. Mailcap core-module is based on the format documented in RFC 1524. The “findmatch()” function does not sanitise the second argument (filename). As a result, the legitimate command (that is used for opening the specified mime type) is concatenated with an arbitrary command, injected by an attacker.
Other sources
A command injection vulnerability was found in the Python mailcap module. The issue occurs due to not adding escape characters into the system mailcap file commands. This flaw allows attackers to inject shell commands into applications that call the mailcap.findmatch function with untrusted input.
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
Python could allow a remote attacker to execute arbitrary commands on the system, caused by improper input validation in mailcap module. By sending a specially-crafted request, an attacker could exploit this vulnerability to execute arbitrary commands on the system.
— IBM
Affected Software
Remediation
Information
Event History
Parent advisories
This vulnerability appears in the following advisories.
Frequently Asked Questions
What is CVE-2015-20107?
CVE-2015-20107 is a command injection vulnerability found in the Python mailcap module.
How does CVE-2015-20107 affect Python?
CVE-2015-20107 affects Python versions up to 3.10.8.
What is the severity of CVE-2015-20107?
CVE-2015-20107 has a severity rating of high.
How can CVE-2015-20107 be exploited?
CVE-2015-20107 can be exploited by injecting shell commands into applications that call mailcap.findmatch with untrusted input.
What is the remedy for CVE-2015-20107?
The recommended remedy for CVE-2015-20107 is to update to the fixed versions of Python mentioned in the references.