Description
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.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | pygments | 2.0.1+dfsg-2 | — |
| Debian 13 | pygments | 2.0.1+dfsg-2 | — |
| Debian 12 | pygments | 2.0.1+dfsg-2 | — |
| Debian 8 | pygments | 2.0.1+dfsg-1.1+deb8u1 | DSA-3445-1 |
| Debian 7 | pygments | 1.5+dfsg-1+deb7u1 | DSA-3445-1 |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 6.0 | pygments | 1.3.1+dfsg-1+deb6u11 | DLA-369-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 14.04 LTS | pygments | 1.6+dfsg-1ubuntu1.1 | USN-2862-1 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | pygments | >= 1.2.2, < 2.1 | 2.1 | GHSA-fff8-4w9p-7v76 |
Advisories 3
- DLA-369-1 pygments - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DSA-3445-1 pygments - security update Debian Security (DSA / DLA) · Mar 9, 2026
- USN-2862-1 pygments vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
References
- USN-2862-1 vendor-advisory
- http://packetstormsecurity.com/files/133823/Pygments-FontManager._get_nix_font_path-Shell-Injection.html
- [oss-security] 20151214 CVE request: Shell Injection in Pygments FontManager._get_nix_font_path mailing-list
- [oss-security] 20151214 Re: CVE request: Shell Injection in Pygments FontManager._get_nix_font_path mailing-list
- 20151001 Shell Injection in Pygments FontManager._get_nix_font_path mailing-list
- DSA-3445 vendor-advisory
- http://www.oracle.com/technetwork/topics/security/bulletinjan2016-2867206.html
- GLSA-201612-05 vendor-advisory
- https://bitbucket.org/birkenfeld/pygments-main/pull-requests/501/fix-shell-injection-in/diff