Pygments is a widely embedded Python code-highlighting library whose modest vulnerability footprint belies its pervasive use across documentation systems, code repositories, wikis, and development tooling. The observed weaknesses center on input-handling and parsing robustness—OS command injection, inefficient regular expressions leading to denial of service, infinite loops, and unrestricted file uploads—reflecting the library's role in processing untrusted source code and markup from external sources. Current CVE counts, severity assessments, and exploitation activity are shown alongside this summary.
The number and severity of CVEs published that impact products developed by Pygments over time
Signals from CVEs in this vendor scope (4 CVEs).
4 CVEs · Highest risk first
| CVE | Published | CVSS | Risk | KEV | Exploit |
|---|---|---|---|---|---|
CVE-2021-27291HIGH In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions. Some of the regular expressions have exponential or cubic wors | Mar 17, 2021 | 7.5 | 26 | NO | NO |
CVE-2021-20270HIGH An infinite loop in SMLLexer in Pygments versions 1.5 to 2.7.3 may lead to denial of service when performing syntax highlighting of a Standard ML (SML) source file, as demonstrated | Mar 23, 2021 | 7.5 | 25 | NO | NO |
CVE-2015-8557CRITICAL 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 | Jan 8, 2016 | 9.0 | 25 | NO | NO |
CVE-2022-40896MEDIUM A ReDoS issue was discovered in pygments/lexers/smithy.py in pygments through 2.15.0 via SmithyLexer. | Jul 19, 2023 | 5.5 | 19 | NO | NO |
Signals from CVEs in this vendor scope (4 CVEs).
An overview of all social media posts that mention a CVE ID that affects a product developed by Pygments.
Media articles that mention a CVE ID that affects a product developed by Pygments — matched by CVE ID, not by vendor name.