CVE-2015-8557: Pygments - Arbitrary Command Execution

pygments Updated 02 Oct 2025

Summary

08/01/2016
Yes i
Critical
9.0

CVE-2015-8557: 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. Affects pygments versions >= 1.2.2, < 2.1. Fixed in 2.1. How to fix ↓

Also tracked for

The same CVE-2015-8557 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Pygments is a syntax highlighting package for various programming languages and markup formats. It provides a way to format and colorize source code for better readability. The vulnerability in Pygments version 1.2.2 through 2.0.2 allows remote attackers to execute arbitrary commands by exploiting shell metacharacters in a font name.

Vulnerability Detail

The vulnerability lies in the FontManager._get_nix_font_path function in the img.py file of Pygments. By manipulating the font name and injecting shell metacharacters, an attacker can execute arbitrary commands on the target system. This can lead to unauthorized access, data leakage, or even complete compromise of the system. It is important to note that this vulnerability affects Pygments versions 1.2.2 through 2.0.2.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "pygments==2.21.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.1

This is the first release that contains the fix.

pip install --upgrade "pygments==2.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no specific workaround mentioned for this vulnerability. The best course of action is to upgrade to the latest version of Pygments.

Conclusion

The vulnerability in Pygments allows remote attackers to execute arbitrary commands on the target system. To mitigate this risk, it is crucial to upgrade to Pygments version 2.1 or later. This ensures that the vulnerability is patched and the system is secure. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for pygments →

Share this vulnerability

FAQ

Pygments is a syntax highlighting package used for formatting and colorizing source code in various programming languages and markup formats.

This vulnerability allows remote attackers to execute arbitrary commands on the target system, potentially leading to unauthorized access, data leakage, or complete compromise of the system.

Pygments versions 1.2.2 through 2.0.2 are affected by this vulnerability.

To fix this vulnerability, it is recommended to upgrade Pygments to version 2.1 or later.

There is no specific workaround mentioned for this vulnerability. Upgrading to the latest version is the recommended solution.

Related vulnerabilities

Recent vulnerabilities recorded for pygments.

How To Fix

Latest published version: 2.21.0 as of 22 Oct 2026

pip install --upgrade "pygments==2.21.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

2.1

This is the first release that contains the fix.

pip install --upgrade "pygments==2.1"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback