CVE-2021-27291In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions. Some of the regular…
- 7.5HighCVSS base score
- 3.9%Exploitation in 30 daysEPSS · top 9.6% of all CVEs
- NoKnown exploitednot in CISA's KEV catalog
- NonePublic exploitsnone known yet
Description
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 worst-case complexity and are vulnerable to ReDoS. By crafting malicious input, an attacker can cause a denial of service.
Timeline
ID reserved
By mitre
- 29 days later
· 29 days later
Published
- 3 years later
· 3 years later
Record updated
Changes after publication (a new score, a public exploit, EPSS crossing 1, 10 or 50 %, leaving KEV) are kept since November 2026; earlier ones are not known.
Scores
| Scored by | CVSS | Score | Vector |
|---|---|---|---|
| NVDNVD · Modified | 3.1 | High7.5 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
- EPSS (exploitation in 30 days)
- 3.9% · top 9.6% of all CVEs (13 Nov 2026)
The list uses the assigner's score when there is one, then CISA's, then NVD's: High 7.5.
Affected products
n/a
- affected n/a
Affected packages
From reviewed advisories of the GitHub Advisory Database.
- PyPIPygmentsGHSA-pq64-v7f5-gqh8 (opens in a new tab)
References
References9
- https://gist.github.com/b-c-ds/b1a2cc0c68a35c57188575eb496de5ce (opens in a new tab)x_refsource_MISCx_transferred
- https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14 (opens in a new tab)x_refsource_MISCx_transferred
- [debian-lts-announce] 20210319 [SECURITY] [DLA 2600-1] pygments security update (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- DSA-4878 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- DSA-4889 (opens in a new tab)vendor-advisoryx_refsource_DEBIANx_transferred
- [debian-lts-announce] 20210505 [SECURITY] [DLA 2648-1] mediawiki security update (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
- FEDORA-2021-166dfc62b2 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- FEDORA-2021-3f975f68c8 (opens in a new tab)vendor-advisoryx_refsource_FEDORAx_transferred
- [debian-lts-announce] 20210506 [SECURITY] [DLA 2648-2] mediawiki regression update (opens in a new tab)mailing-listx_refsource_MLISTx_transferred
Sources
The same CVE in the primary databases and aggregators, to check against.
- CVE.org record (opens in a new tab)
- CVE List JSON (GitHub) (opens in a new tab)
- NVD (opens in a new tab)
- FIRST EPSS (opens in a new tab)
- EUVD EUVD-2021-0208 (opens in a new tab)
- OSV.dev (opens in a new tab)
- GitHub Advisory GHSA-pq64-v7f5-gqh8 (opens in a new tab)
- CIRCL Vulnerability-Lookup (opens in a new tab)
Badge for a README or a ticket
[](https://cveledger.app/cve/CVE-2021-27291)Record last updated .