Command Injection in Pygments
The FontManager._get_nix_font_path function in formatters/img.py in Pygments 1.2.2 through 2.0.2 allows remote attackers to execute arbitrary commands via shell metacharacters in a font name.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Python (PyPI) | pygments | >= 1.2.2, < 2.1 | 2.1 |
References
- http://packetstormsecurity.com/files/133823/Pygments-FontManager._get_nix_font_path-Shell-Injection.html
- http://www.openwall.com/lists/oss-security/2015/12/14/6
- http://seclists.org/fulldisclosure/2015/Oct/4
- http://www.ubuntu.com/usn/USN-2862-1
- https://bitbucket.org/birkenfeld/pygments-main/pull-requests/501/fix-shell-injection-in/diff
- http://www.openwall.com/lists/oss-security/2015/12/14/17
- http://www.oracle.com/technetwork/topics/security/bulletinjan2016-2867206.html
- http://www.debian.org/security/2016/dsa-3445
- https://security.gentoo.org/glsa/201612-05
- https://github.com/advisories/GHSA-fff8-4w9p-7v76
- https://nvd.nist.gov/vuln/detail/CVE-2015-8557
- https://github.com/pygments/pygments/commit/db6dd826f8624179e563aaded391efe824462f51
- https://github.com/pygments/pygments
- https://github.com/pypa/advisory-database/tree/main/vulns/pygments/PYSEC-2016-32.yaml
- CVSS vector
CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H- Weakness (CWE)
CWE-78- Platform
- Python (PyPI)
- Package
pygments- Disclosed
- 08.01.2016
- Updated
- 11.10.2026 11:20
Sources and licenses
OSV / GitHub Advisory Database - PYSEC-2016-32 - PyPA Advisory Database; CC BY 4.0
OSV / GitHub Advisory Database - GHSA-fff8-4w9p-7v76 - CC BY 4.0
Vulnerability history: pygments
All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 5
- First → latest
- 01.2016 03.2026
- Without a fix
- 0
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 2
- Medium 1
- Low 1
Disclosures per year
- 2017: 0
- 2018: 0
- 2019: 0
- 2020: 0
- 2021: 2
- 2022: 0
- 2023: 1
- 2024: 0
- 2025: 0
- 2026: 1
earlier: 1
-
Command Injection in Pygments this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.