Skip to main content
HIGH

CVE-2021-27291

CVSS v3

7.5

HIGH

EPSS Score

3.9 %

exploit probability, as of 2026-10-19

CISA KEV

No

known exploited

Exploitation

—

SSVC status

Get an alert for each new CVE published for pygments.

Set up CVE WatchFree account · no credit card

Affected and fixed versions

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

  • pygmentsPyPIfrom 1.1 · fixed in 2.7.4
  • babelAlmaLinux:8all versions · fixed in 2.5.1-10.module_el8.6.0+2781+fed64c13and 1 other package
  • python-nose-docsAlmaLinux:8all versions · fixed in 1.3.7-31.module_el8.5.0+2569+5c5719bc
  • python-sqlalchemy-docAlmaLinux:8all versions · fixed in 1.3.2-2.module_el8.5.0+2569+5c5719bc
  • python-virtualenv-docAlmaLinux:8all versions · fixed in 15.1.0-21.module_el8.5.0+135+5ce32bc4
  • python2-attrsAlmaLinux:8all versions · fixed in 17.4.0-10.module_el8.6.0+2781+fed64c13
  • python2-backportsAlmaLinux:8all versions · fixed in 1.0-16.module_el8.6.0+2781+fed64c13
  • python2-backports-ssl_match_hostnameAlmaLinux:8all versions · fixed in 3.5.0.1-12.module_el8.6.0+2781+fed64c13

50 more package ranges on OSV.dev

Vendor advisories

  • CVE-2021-27291 Red Hat Product Security488 products fixed · 11 known affected

    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

  • RHSA-2021:4150 Red Hat Product Security82 products fixed

    Red Hat Security Advisory: python36:3.6 security and bug fix update

  • RHSA-2021:4151 Red Hat Product Security264 products fixed

    Red Hat Security Advisory: python27:2.7 security update

  • RHSA-2021:4139 Red Hat Product Security36 products fixed

    Red Hat Security Advisory: resource-agents security, bug fix, and enhancement update

  • RHSA-2021:3252 Red Hat Product Security80 products fixed

    Red Hat Security Advisory: python27 security update

  • RHSA-2021:0781 Red Hat Product Security26 products fixed

    Red Hat Security Advisory: Red Hat Ansible Automation Platform 1.2.2 security and bug fix update

Full record on NVD

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.

Technical details

Published
2021-03-17

Frequently asked questions

What is CVE-2021-27291?

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.

Is CVE-2021-27291 actively exploited?

Active exploitation of CVE-2021-27291 has not been confirmed. Its EPSS score was 3.9% on 2026-10-19, the estimated probability of exploitation in the next 30 days.

What is the CVSS score for CVE-2021-27291?

CVE-2021-27291 has a CVSS v3 base score of 7.5 (HIGH severity).

Running pygments? Hear about its next vulnerability

CVE Watch matches each new CVE to the vendors and products you list (vendor and product, not the version) and puts it in your alerts with its KEV and EPSS status.

Already have an account? Open CVE WatchNo credit card required · No monthly cap on website lookups · 250 API requests/month