In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely…
Priority LOW 39CWE-1333Published · Updated
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · High
- Fix status
- Partial Red Hat: 8 fixed, 3 without a fix
Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-1333.
Summary
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.
Why it matters now
EPSS 0.03906 90th percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Partial Pygments (PyPI): 2.7.4Red Hat: 5 advisoriesRed Hat: 8 fixed, 3 without a fix
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | Pygments (PyPI) | 1.1 to before 2.7.4 | 2.7.4 | Patch available | GHSA-pq64-v7f5-gqh8 |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- Pygments (PyPI) Vendor— Affected 1.1 to before 2.7.4 Fixed in 2.7.4 Patch available GHSA-pq64-v7f5-gqh8
CPE configurations NVD · 5
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:* | 1.1 to before 2.7.4 | Vulnerable | Pygments |
| cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* | 9.0 | Vulnerable | Debian |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
| cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* | 32 | Vulnerable | Fedoraproject |
| cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* | 33 | Vulnerable | Fedoraproject |
- cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:* Versions 1.1 to before 2.7.4 Vulnerable ·Pygments
- cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:* Versions 9.0 Vulnerable ·Debian
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
- cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:* Versions 32 Vulnerable ·Fedoraproject
- cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
Remediation
- Fix · GHSA-pq64-v7f5-gqh8 Pygments (PyPI) Fixed in 2.7.4 Advisory →
Red Hat 5 advisories
- RHSA-2021:4150 Released 2021-11-09 · Red Hat rating Moderatepython36:3.6 security and bug fix update
- Red Hat Enterprise Linux AppStream (v. 8) python-PyMySQL-0.10.1-2.module+el8.4.0+9657+a4b6a102.src::python36:3.6, python-distro-1.4.0-2.module+el8.1.0+3334+5cb623d7.src::python36:3.6, python-docs-3.6.7-2.module+el8.1.0+3334+5cb623d7.src::python36:3.6 +47
- RHSA-2021:4151 Released 2021-11-09 · Red Hat rating Moderatepython27:2.7 security update
- Red Hat Enterprise Linux AppStream (v. 8) Cython-0.28.1-7.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, PyYAML-3.12-16.module+el8.1.0+3111+de3f2d8e.src::python27:2.7, babel-2.5.1-10.module+el8.5.0+11014+88fc0d0b.noarch::python27:2.7 +47
- RHSA-2021:4139 Released 2021-11-09 · Red Hat rating Moderateresource-agents security, bug fix, and enhancement update
- Red Hat Enterprise Linux High Availability (v. 8) resource-agents-4.1.1-98.el8, resource-agents-aliyun-4.1.1-98.el8, resource-agents-gcp-4.1.1-98.el8 +1
- Red Hat Enterprise Linux Resilient Storage (v. 8) resource-agents-4.1.1-98.el8, resource-agents-aliyun-4.1.1-98.el8, resource-agents-gcp-4.1.1-98.el8 +1
Show 2 more Red Hat advisories
- RHSA-2021:3252 Released 2021-08-24 · Red Hat rating Moderatepython27 security update
- Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) python27-babel-0.9.6-10.el7, python27-python-2.7.18-3.el7, python27-python-babel-0.9.6-10.el7 +8
- RHSA-2021:0781 Released 2021-03-09 · Red Hat rating ModerateRed Hat Ansible Automation Platform 1.2.2 security and bug fix update
- Red Hat Automation Hub 4.2 for RHEL 7 automation-hub-4.2.2-1.el7pc, python-bleach-3.3.0-1.el7pc, python-bleach-allowlist-1.0.3-1.el7pc +9
- Red Hat Automation Hub 4.2 for RHEL 8 automation-hub-4.2.2-1.el8pc, python-bleach-3.3.0-1.el8pc, python-bleach-allowlist-1.0.3-1.el8pc +9
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Out of support scope |
| Red Hat Enterprise Linux 7 | Affected | No fix planned: Out of support scope |
| Red Hat OpenStack Platform 10 (Newton) | Affected | No fix planned: Out of support scope |
| Red Hat Automation Hub 4.2 for RHEL 7 | Fixed | RHSA-2021:0781 |
| Red Hat Automation Hub 4.2 for RHEL 8 | Fixed | RHSA-2021:0781 |
| Red Hat Enterprise Linux AppStream (v. 8) | Fixed | RHSA-2021:4150, RHSA-2021:4151 |
| Red Hat Enterprise Linux High Availability (v. 8) | Fixed | RHSA-2021:4139 |
| Red Hat Enterprise Linux Resilient Storage (v. 8) | Fixed | RHSA-2021:4139 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server (v. 7) | Fixed | RHSA-2021:3252 |
| Red Hat Software Collections for Red Hat Enterprise Linux Server EUS (v. 7.7) | Fixed | RHSA-2021:3252 |
| Red Hat Software Collections for Red Hat Enterprise Linux Workstation (v. 7) | Fixed | RHSA-2021:3252 |
Timeline
- 2026-10-02 Threatist record created from CVE-2021-27291
- 2026-10-03 Alias added: GHSA-pq64-v7f5-gqh8
- 2026-10-07 EPSS moved to the 90th–95th percentile
References
Advisory 8
- [debian-lts-announce] 20210319 [SECURITY] [DLA 2600-1] pygments security update
- DSA-4878
- DSA-4889
- [debian-lts-announce] 20210505 [SECURITY] [DLA 2648-1] mediawiki security update
- FEDORA-2021-166dfc62b2
- FEDORA-2021-3f975f68c8
- [debian-lts-announce] 20210506 [SECURITY] [DLA 2648-2] mediawiki regression update
- https://nvd.nist.gov/vuln/detail/CVE-2021-27291
Other 4
- https://github.com/pygments/pygments
- https://github.com/pypa/advisory-database/tree/main/vulns/pygments/PYSEC-2021-141.yaml
- https://lists.fedoraproject.org/archives/list/[email protected]/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55
- https://lists.fedoraproject.org/archives/list/[email protected]/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ
Sources
- CVE-2021-27291 · CVE Program
- CVE-2021-27291 · NVD
- FIRST EPSS
- GHSA-pq64-v7f5-gqh8 · GitHub Advisory Database · CC BY 4.0
- CVE-2021-27291 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences