CVE-2021-27291: In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions.
Noroxi assessment
Priority: Monitor (action score 31/100)
- The sources we track (CISA KEV, Exploit-DB, Metasploit, Nuclei, GitHub) show no public exploit code or exploitation in the wild.
- Probability of exploitation in the next 30 days: 3.9% (FIRST EPSS); higher than 90.3% of all records.
- Anyone who can reach it over the internet can trigger it. No account or password is required. No user action is required. No special conditions are required; it is repeatable.
- Fixed version: n/a n/a 2.7.4.
Low priority for now. Upgrade to n/a n/a 2.7.4 or later.
Generated automatically from the record's data: CVSS (NVD and CNA), CISA KEV and SSVC, FIRST EPSS, exploit sources, fixed versions. How we calculate it
Primary sources: NVD · CVE.org · FIRST EPSS
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.
- BDU:2021-03741
- GHSA-pq64-v7f5-gqh8
- ALSA-2021:4139
- ALSA-2021:4150
- ALSA-2021:4151
- DLA-2600-1
- DLA-2648-1
- DSA-4878-1
- DSA-4889-1
- openSUSE-SU-2021:1521-1
- openSUSE-SU-2021:3839-1
- openSUSE-SU-2021:3841-1
- PYSEC-2021-141
- RHSA-2021:0781
- RHSA-2021:3252
- RHSA-2021:4139
- RHSA-2021:4150
- RHSA-2021:4151
- RLSA-2021:4139
- RLSA-2021:4150
- Published
- Mar 17, 2021
- Updated
- Jun 16, 2026
- EPSS
- 3.9% · 90th percentile
- CWE
- CWE-1333
Report tools
Action score
31
Monitor
Low priority for now.
- CVSS
- 30 / 40 · 7.5 / 10
- CISA KEV
- 0 / 30 · Not listed
- EPSS
- 1 / 30 · 3.9%
Get told when this record changes
- Not in KEV: no record of exploitation in the wild
- No public exploit code on record
- A fix has been released
If any of these changes, we'll tell you in the daily email digest.
Running WordPress? Scan your site free with WP Lens
Noroxi analysis
What does it mean in your environment?
The assessment above is generated automatically from the record's data; it doesn't know your environment. Our team verifies on your systems whether this vulnerability is actually exploitable and which mitigation is enough.
We use this product, ask for helpAffected systems
Is your version affected?
Pick the product and type the version you run. It's compared with this record's version ranges in your browser; the version isn't sent anywhere.
| Vendor | Product | CPE |
|---|---|---|
| pygments | pygments | cpe:2.3:a:pygments:pygments |
| debian | debian linux | cpe:2.3:o:debian:debian_linux |
| fedoraproject | fedora | cpe:2.3:o:fedoraproject:fedora |
Affected versions
NVD version ranges (for catalog products). Add the product to your stack with a version and matching uses these.
- debian debian linux10.0
- debian debian linux9.0
- fedoraproject fedora32
- fedoraproject fedora33
- pygments pygments1.1 and later · before 2.7.4
Package-level exposure
OSV and GitHub Advisory data: ecosystem, package and range. SBOM matching uses this table.
| Ecosystem | Package | Affected range | Fix |
|---|---|---|---|
| AlmaLinux:8 | babel | before 2.5.1-10.module_el8.6.0+2781+fed64c13 | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python-nose-docs | before 1.3.7-31.module_el8.5.0+2569+5c5719bc | 1.3.7-31.module_el8.5.0+2569+5c5719bc |
| AlmaLinux:8 | python-nose-docs | before 1.3.7-31.module_el8.6.0+2781+fed64c13 | 1.3.7-31.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python-psycopg2-doc | before 2.7.5-7.module_el8.6.0+2781+fed64c13 | 2.7.5-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python-pymongo-doc | before 3.7.0-1.module_el8.5.0+135+5ce32bc4 | 3.7.0-1.module_el8.5.0+135+5ce32bc4 |
| AlmaLinux:8 | python-pymongo-doc | before 3.7.0-1.module_el8.5.0+2569+5c5719bc | 3.7.0-1.module_el8.5.0+2569+5c5719bc |
| AlmaLinux:8 | python-sqlalchemy-doc | before 1.3.2-2.module_el8.6.0+2781+fed64c13 | 1.3.2-2.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python-sqlalchemy-doc | before 1.3.2-2.module_el8.5.0+2569+5c5719bc | 1.3.2-2.module_el8.5.0+2569+5c5719bc |
| AlmaLinux:8 | python-virtualenv-doc | before 15.1.0-21.module_el8.5.0+2569+5c5719bc | 15.1.0-21.module_el8.5.0+2569+5c5719bc |
| AlmaLinux:8 | python-virtualenv-doc | before 15.1.0-21.module_el8.5.0+135+5ce32bc4 | 15.1.0-21.module_el8.5.0+135+5ce32bc4 |
| AlmaLinux:8 | python2-attrs | before 17.4.0-10.module_el8.6.0+2781+fed64c13 | 17.4.0-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-babel | before 2.5.1-10.module_el8.6.0+2781+fed64c13 | 2.5.1-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-backports | before 1.0-16.module_el8.6.0+2781+fed64c13 | 1.0-16.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-backports-ssl_match_hostname | before 3.5.0.1-12.module_el8.6.0+2781+fed64c13 | 3.5.0.1-12.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-bson | before 3.7.0-1.module_el8.6.0+2781+fed64c13 | 3.7.0-1.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-chardet | before 3.0.4-10.module_el8.6.0+2781+fed64c13 | 3.0.4-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-coverage | before 4.5.1-4.module_el8.6.0+2781+fed64c13 | 4.5.1-4.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-Cython | before 0.28.1-7.module_el8.6.0+2781+fed64c13 | 0.28.1-7.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-dns | before 1.15.0-10.module_el8.6.0+2781+fed64c13 | 1.15.0-10.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docs | before 2.7.16-2.module_el8.6.0+2781+fed64c13 | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docs-info | before 2.7.16-2.module_el8.6.0+2781+fed64c13 | 2.7.16-2.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-docutils | before 0.14-12.module_el8.6.0+2781+fed64c13 | 0.14-12.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-funcsigs | before 1.0.2-13.module_el8.6.0+2781+fed64c13 | 1.0.2-13.module_el8.6.0+2781+fed64c13 |
| AlmaLinux:8 | python2-idna | before 2.5-7.module_el8.6.0+2781+fed64c13 | 2.5-7.module_el8.6.0+2781+fed64c13 |
+96
Same product
pygments: all recordsOther highest-scoring records for the same primary product.
- CVE-2015-8557The FontManager._get_nix_font_path function in formatters/img.py in Pygments 1.2.2 through 2.0.2 allows remote attackers to execute arbitrar38Monitor
- CVE-2021-20270An 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 Standa31Monitor
- CVE-2022-40896A ReDoS issue was discovered in pygments/lexers/smithy.py in pygments through 2.15.0 via SmithyLexer.22Monitor
Remediation
Which version to upgrade to
Fix versions compiled from the vendor, package registries and Microsoft. Verify the vendor's note before upgrading.
| Product / package | Fixed version | Source |
|---|---|---|
| n/a n/a | 2.7.4 · description | Vendor (CNA) |
| almalinux:python-nose-docs | 1.3.7-31.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python-pymongo-doc | 3.7.0-1.module_el8.5.0+135+5ce32bc4 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python-sqlalchemy-doc | 1.3.2-2.module_el8.6.0+2781+fed64c13 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python-virtualenv-doc | 15.1.0-21.module_el8.5.0+2569+5c5719bc · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python3-bson | 3.7.0-1.module_el8.5.0+135+5ce32bc4 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python3-distro | 1.4.0-2.module_el8.5.0+135+5ce32bc4 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python3-docs | 3.6.7-2.module_el8.5.0+2569+5c5719bc · AlmaLinux:8 | Package registry (OSV) |
| almalinux:python3-PyMySQL | 0.10.1-2.module_el8.5.0+2569+5c5719bc · AlmaLinux:8 | Package registry (OSV) |
| almalinux:resource-agents | 4.1.1-98.el8 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:resource-agents-aliyun | 4.1.1-98.el8 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:resource-agents-gcp | 4.1.1-98.el8 · AlmaLinux:8 | Package registry (OSV) |
| almalinux:resource-agents-paf | 4.1.1-98.el8 · AlmaLinux:8 | Package registry (OSV) |
| alpine:py3-pygments | 2.5.2-r1 · Alpine:v3.11 | Package registry (OSV) |
| debian:mediawiki | 1:1.35.2-1 · Debian:12 | Package registry (OSV) |
| debian:pygments | 2.7.1+dfsg-2.1 · Debian:12 | Package registry (OSV) |
| opensuse:python-Pygments | 2.6.1-lp152.5.12.1 · openSUSE:Leap 15.2 | Package registry (OSV) |
| PyPI:pygments | 2.7.4 | Package registry (OSV) |
| red hat:automation-hub | 0:4.2.2-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python-bleach | 0:3.3.0-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python-bleach-allowlist | 0:1.0.3-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python-galaxy-importer | 0:0.2.15-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python-galaxy-ng | 0:4.2.2-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python-pulp-ansible | 1:0.5.6-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-bleach | 0:3.3.0-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-bleach-allowlist | 0:1.0.3-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-django | 0:2.2.18-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-galaxy-importer | 0:0.2.15-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-galaxy-ng | 0:4.2.2-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
| red hat:python3-pulp-ansible | 1:0.5.6-1.el7pc · Red Hat:ansible_automation_platform:4.2::el7 | Package registry (OSV) |
+13
Exploit status
No known public exploit
No public exploit has been observed yet. That doesn't mean you're safe, only that the bar is a little higher.
Research context
For pentesters and researchers: attack profile, score disagreement, timeline, patch commits, credits, variant and chain candidates, bug bounty scope. All derived from existing data; no exploit code.
Timeline
From publication to today: proof of concept, Metasploit module, CISA KEV and fix record. Dates are as reported by the sources.
No dated events beyond publication.
No history yet (it accumulates with the daily EPSS job).
Patch and commit links
Commit, PR and diff links among the references. A starting point for patch-diffing and variant hunting; fixes, not exploits.
Credits
All researchersFinders, reporters and analysts named in the CNA record. Click a name for that researcher’s other records.
No credits in the CNA record.
Variant candidates
Same product, same weakness class, within 18 months. If the patch missed the root cause, the sibling bug is here.
No nightly-computed relations.
Chain candidates
An authentication bypass and a privilege-requiring bug in the same product, published close together: combined they may become an unauthenticated path.
—
Bug bounty scope
No known public program.
Source: bounty-targets-data (public HackerOne, Bugcrowd, Intigriti, YesWeHack listings).
Technical details
Attack conditions
- Anyone who can reach it over the internet can trigger it.
- No account or password is required.
- No user action is required.
- No special conditions are required; it is repeatable.
If successful
- Confidentiality
- none
- Integrity
- none
- Availability
- high · the service can be disrupted
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- None
- Scope
- Unchanged
- Confidentiality impact
- None
- Integrity impact
- None
- Availability impact
- High
Weakness class (CWE)
CWE-1333 · Inefficient Regular Expression ComplexityCVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
nvd-primary
Attack context
MITRE CAPEC attack patterns and ATT&CK techniques for this weakness class (CWE). A starting point for detection rules and threat hunting.
Attack patterns (CAPEC)
ATT&CK techniques
—
Change log
- Fix✗ → ✓
For records you follow, these changes also arrive as notifications. →
References
Show all references (7 more)Show less
- lists.debian.org/debian-lts-announce/2021/03/msg00024.html
- lists.debian.org/debian-lts-announce/2021/05/msg00003.html
- lists.debian.org/debian-lts-announce/2021/05/msg00006.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55/
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ/
- www.debian.org/security/2021/dsa-4878
- www.debian.org/security/2021/dsa-4889
Vendor advisories and official records. Exploit/PoC links are deliberately left out.