Install
Pygments
Pygments is a syntax highlighting package written in Python.
2.21.0Latest, 17 Aug 2026
1.2BDownloads, last month
0Advisories on the latest
10Advisories, all versions
BSD-2-ClauseLicence
2.2KStars
6.2/10OpenSSF Scorecard
Source · Homepage · Ask AI Mode · · Markdown
Known advisories
| Severity | Advisory | Fix | Published |
|---|---|---|---|
| Pygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching CVE-2026-4539 | Fixed in 2.20.0 | 13 Jul 2026 | |
| Low | Pygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching CVE-2026-4539 | Fixed in 2.20.0 | 22 Mar 2026 |
| Moderate | Pygments vulnerable to ReDoS CVE-2022-40896 | Fixed in 2.15.0 | 19 Jul 2023 |
| PYSEC-2023-117 CVE-2022-40896 | Fixed in 2.15.1 | 19 Jul 2023 | |
| Critical | Command Injection in Pygments CVE-2015-8557 | Fixed in 2.1 | 17 May 2022 |
| High | Infinite Loop in Pygments CVE-2021-20270 | Fixed in 2.7.4 | 20 Apr 2021 |
| High | Pygments vulnerable to Regular Expression Denial of Service (ReDoS) CVE-2021-27291 | Fixed in 2.7.4 | 29 Mar 2021 |
| PYSEC-2021-140 CVE-2021-20270 | Fixed in 2.7.4 | 23 Mar 2021 | |
| PYSEC-2021-141 CVE-2021-27291 | Fixed in 2.7.4 | 17 Mar 2021 | |
| PYSEC-2016-32 CVE-2015-8557 | Fixed in 2.1 | 8 Jan 2016 |
In the news
- Pygments – Syntax Highlighting for Code and Text in python dev.to, 24 Oct 2025
- How can I create and use a custom Pygments style for the minted package? tex.stackexchange.com, 28 Dec 2024
- How to use Dracula theme as a style in Pygments? stackoverflow.com, 25 Dec 2024
- Pygments command line not syntax highlighting HTML output stackoverflow.com, 8 Dec 2024
- How to use the different styles (mainly color schemes) of minted (pygments)? tex.stackexchange.com, 6 Dec 2024
On Hacker News
- GitHub dropped Pygments 184 points, 129 comments, 24 Nov 2014
- Pygments, a generic syntax highlighter 85 points, 36 comments, 16 Feb 2015
- Pocoo (Flask, Jinja 2, Pygments, Sphinx, Werkzeug) 32 points, 11 comments, 28 Nov 2010
- Ask HN: check out my micro app - pygments syntax highlighter via HTTP 25 points, 3 comments, 17 Sep 2009
Sources: PyPI, deps.dev (CC BY 4.0), OSV. Last checked 3 Dec 2026.