CVE-2021-27291
No exploitation reported by the sources we read.
- Published2021-03-17
- Fixed in2.7.4
- WeaknessCWE-1333
Am I affected?
Debian, Ubuntu or Red Hat sometimes backport a fix without changing the upstream version number: such a version reads « to verify », never « affected ».With a domain, we read the version its public headers and pages expose. A distribution build can carry the fix under an older number.
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
dates in UTC- 2021-03-1713:15CVE publishedNVD
Versions per branch
NVD · OSV| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 2.7 | ≥ 1.1, < 2.7.4 | 2.7.4 | NVD · OSV |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 9.0 | = 9.0 | no fix published | NVD |
| 10.0 | = 10.0 | no fix published | NVD |
| Branch | Affected | Fixed in | Source |
|---|---|---|---|
| 32.x | = 32 | no fix published | NVD |
| 33.x | = 33 | no fix published | NVD |
as publishedRanges as NVD and OSV publish them; a distribution’s build can be fixed under an older number.
Distribution builds and vendor advisories
Packages from OSV.dev and products from the vendors' CSAF advisories.
version not verifiedVersions not verified: read as OSV.dev and the vendors publish them, not checked against each vendor's release list.
Packages
- automation-hubRed Hat:ansible_automation_platform:4.2::el8all versions · fixed in 0:4.2.2-1.el8pcand 2 other packages
- automation-hubRed Hat:ansible_automation_platform:4.2::el7all versions · fixed in 0:4.2.2-1.el7pcand 2 other packages
- babelRocky Linux:8all versions · fixed in 0:2.5.1-10.module+el8.5.0+706+735ec4b3
- babelRed Hat:enterprise_linux:8::appstreamall versions · fixed in 0:2.5.1-10.module+el8.5.0+11014+88fc0d0band 1 other package
- babelAlmaLinux:8all versions · fixed in 2.5.1-10.module_el8.6.0+2781+fed64c13and 1 other package
- CythonRocky Linux:8all versions · fixed in 0:0.28.1-7.module+el8.4.0+403+9ae17a31
- CythonRocky Linux:8all versions · fixed in 0:0.28.1-7.module+el8.5.0+706+735ec4b3
- CythonRed Hat:enterprise_linux:8::appstreamall versions · fixed in 0:0.28.1-7.module+el8.1.0+3111+de3f2d8eand 3 other packages
249 more package ranges on OSV.dev
Vendor advisories
python-pygments: ReDoS in multiple lexers
python-pygments.src as a component of Red Hat Enterprise Linux 6 · python-pygments.src as a component of Red Hat Enterprise Linux 7 · resource-agents as a component of Red Hat Enterprise Linux 7 · +8 more
Red Hat Security Advisory: python36:3.6 security and bug fix update
Red Hat Security Advisory: python27:2.7 security update
Red Hat Security Advisory: resource-agents security, bug fix, and enhancement update
Red Hat Security Advisory: python27 security update
Red Hat Security Advisory: Red Hat Ansible Automation Platform 1.2.2 security and bug fix update
Fix
- Update Pygments to 2.7.4
- Vendor fix Red Hat Product Security RHSA-2021:4150 · 82 productsFor details on how to apply this update, which includes the changes described in this advisory, refer to: https://access.redhat.com/articles/11258
- Vendor fix Red Hat Product Security RHSA-2021:0781 · 26 productsBefore applying this update, make sure all previously released errata relevant to your system have been applied. For details on how to apply this update, refer to: https://access.redhat.com/articles/11258
- No fix planned, says the vendor Red Hat Product Security CVE-2021-27291 · 11 productsOut of support scope
Advisories and patches
- github.comPatch
Detection
- Nuclei template
- none so far ProjectDiscovery
- Exploit-DB
- no entry Exploit-DB
- Proof of concept
- PoC-in-GitHubno public repository identifiedread 2026-12-04
- Metasploit modules
- none listed Metasploit Framework
Sources
- NVDCVSS 3.17.5read 2026-10-23
- NVDCVSS 2.05read 2026-10-23
- NVDweakness (CWE)CWE-1333read 2026-10-23
- FIRST EPSSEPSS score3.9 %2026-12-04
- OSVaffected packages—
- GitHub AdvisoriesadvisoryHigh2021-03-22
Identifiers
- AZL-35138same flawAzure Linux · MIT
- AZL-6812same flawAzure Linux · MIT
- EUVD-2021-0208same flawENISA EUVD · LicenseRef-ENISA-legal-notice
- GHSA-pq64-v7f5-gqh8same flawGitHub Advisory Database · CC-BY-4.0
- MINI-cwpv-qv63-x845same flawMinimOS · LicenseRef-unstated
- PYSEC-2021-141same flawPyPA Advisory Database · CC-BY-4.0
- ALSA-2021:4139advisory covering several CVEsAlmaLinux · MIT
- ALSA-2021:4150advisory covering several CVEsAlmaLinux · MIT
- ALSA-2021:4151advisory covering several CVEsAlmaLinux · MIT
- DLA-2600-1advisory covering several CVEsDebian · LicenseRef-unstated
- DLA-2648-1advisory covering several CVEsDebian · LicenseRef-unstated
- DSA-4878-1advisory covering several CVEsDebian · LicenseRef-unstated
- DSA-4889-1advisory covering several CVEsDebian · LicenseRef-unstated
- MGASA-2021-0218advisory covering several CVEsMageia · LicenseRef-unstated
- MGASA-2021-0245advisory covering several CVEsMageia · LicenseRef-unstated
- OESA-2021-1154advisory covering several CVEsopenEuler · LicenseRef-unstated
- openSUSE-SU-2021:1521-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2021:3839-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- openSUSE-SU-2021:3841-1advisory covering several CVEsopenSUSE · LicenseRef-unstated
- RHSA-2021:0781advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2021:3252advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2021:4139advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2021:4150advisory covering several CVEsRed Hat · CC-BY-4.0
- RHSA-2021:4151advisory covering several CVEsRed Hat · CC-BY-4.0
- RLSA-2021:4139advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2021:4150advisory covering several CVEsRocky Linux · BSD-3-Clause
- RLSA-2021:4151advisory covering several CVEsRocky Linux · BSD-3-Clause
- SUSE-SU-2021:3814-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2021:3839-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2021:3840-1advisory covering several CVEsSUSE · LicenseRef-unstated
- SUSE-SU-2021:3841-1advisory covering several CVEsSUSE · LicenseRef-unstated
- USN-4897-1advisory covering several CVEsUbuntu
- USN-4897-2advisory covering several CVEsUbuntu
Technical details
- CVSS v3 vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Published
- 2021-03-17
- Last modified
- 2026-06-17
- NVD status
- Modified
- GitHub advisory
- GHSA-pq64-v7f5-gqh8
Frequently asked questions
What is CVE-2021-27291?
Is CVE-2021-27291 actively exploited?
What is the CVSS score for CVE-2021-27291?
Running pygments? Hear about its next vulnerability
Surveillance reads the versions in your stack — a domain, a lockfile or a list — checks each CVE against the ranges its sources publish, and alerts you when one you run is exploited or enters CISA KEV. A version it cannot read stays « version not verified ».
No credit card required · No monthly cap on website checks · 250 API requests/month
Go further
- Following what attackers exploit right now? The CISA KEV additions of the month, with their patch deadlines.
- Running this software? Vulnerability monitoring alerts you to new vulnerabilities in your products.
Related vulnerabilities
Same product first, then the same vendor advisory and the same publication week.
Sources for this record
- CVE Program · CVE Program Terms of Use
- ENISA EU Vulnerability Database · ENISA legal notice §1.2 (reproduction authorised, provided the source is acknowledged)
- FIRST EPSS · EPSS terms of use (free use, attribution requested)
- GitHub Advisory Database · CC-BY-4.0 · GHSA-pq64-v7f5-gqh8
- NVD · Public domain (17 U.S.C. § 105) for NVD-authored data; third-party content under its own terms
- OSV.dev · Per record, as its publisher states it: each row carries the label in sourceLicense when one is served
- Red Hat Product Security (CSAF and VEX) · CC-BY-4.0