CVE-2015-20107
Python vulnerability analysis and mitigation

Overview

CVE-2015-20107 affects Python (CPython) versions up to 3.10.8, where the mailcap module fails to properly add escape characters into commands discovered in the system mailcap file. The vulnerability was initially discovered on August 2, 2015, and was assigned a CVE identifier on April 13, 2022. The issue affects multiple Python versions including 2.7, 3.7, 3.8, 3.9, and 3.10 (Python Security).

Technical details

The vulnerability exists in the mailcap.findmatch() function, which returns a command line that can be passed to os.system(). When processing filenames containing shell metacharacters, the function fails to properly escape these characters, potentially allowing command injection. The vulnerability has been assigned a CVSS v3.1 base score of 7.6 (High) with the vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:L (NVD).

Impact

Successful exploitation of this vulnerability could allow attackers to inject shell commands into applications that call mailcap.findmatch with untrusted input, particularly when they lack validation of user-provided filenames or arguments. This could lead to disclosure of sensitive information, addition or modification of data, or Denial of Service (DoS) (NetApp Advisory).

Mitigation and workarounds

The vulnerability has been fixed in Python versions 3.7.16, 3.8.16, 3.9.16, 3.10.8, and 3.11.0. The fix prevents injection of ASCII characters other than alphanumerics and @+=:,./-_ into the returned command line. Users should upgrade to these or later versions. For systems that cannot be immediately upgraded, input validation should be implemented to sanitize filenames before passing them to mailcap.findmatch() (Python Security).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-67511CRITICAL9.6
  • PythonPython
  • cai-framework
NoNoDec 11, 2025
CVE-2025-13780CRITICAL9.1
  • PythonPython
  • pgadmin4
NoYesDec 11, 2025
CVE-2025-67644HIGH7.3
  • PythonPython
  • langgraph-checkpoint-sqlite
NoYesDec 11, 2025
CVE-2025-67720MEDIUM6.5
  • PythonPython
  • pyrofork
NoYesDec 11, 2025
CVE-2025-67485MEDIUM5.3
  • PythonPython
  • mad-proxy
NoNoDec 10, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management