cve.bz

CVE-2021-27291

7.5 highExploit referenceEPSS 3.9%Fix available

High (7.5). EPSS 3.9% estimated probability of exploitation activity in the next 30 days. Fixed in pygments 2.7.4.

On this page
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.

Severity

CVSS 3.1

7.5 high
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS
3.9% (unchanged from 3.9% a week ago; 3.9% 30 days ago) estimated probability of exploitation activity in the next 30 days; 91st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-1333 Inefficient Regular Expression Complexity
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2021-27291 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-27291?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-27291?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2021-27291 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
pygments:pygmentsfrom 1.1 before 2.7.4
debian:debian_linux9.0
debian:debian_linux10.0
fedoraproject:fedora32
fedoraproject:fedora33

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-pq64-v7f5-gqh8PyPIpygments>=1.1 <2.7.42.7.4
PYSEC-2021-141PyPIpygments>=1.1 <2.7.42.7.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9mediawiki1:1.27.7-1~deb9u8DLA-2648-1
Debian9pygments2.2.0+dfsg-1+deb9u2DLA-2600-1
Debian10mediawiki1:1.31.14-1~deb10u1DSA-4889-1
Debian10pygments2.3.1+dfsg-1+deb10u2DSA-4878-1
Debian12, 13, 14mediawiki1:1.35.2-1DEBIAN-CVE-2021-27291
Debian12, 13, 14pygments2.7.1+dfsg-2.1DEBIAN-CVE-2021-27291
Ubuntu16.04:LTSpygments2.1+dfsg-1ubuntu0.2UBUNTU-CVE-2021-27291 USN-4897-1
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 5 moreericno fix listedUBUNTU-CVE-2021-27291
Ubuntu18.04:LTSpygments2.2.0+dfsg-1ubuntu0.2UBUNTU-CVE-2021-27291 USN-4897-1
Ubuntu20.04:LTSpygments2.3.1+dfsg-1ubuntu2.2UBUNTU-CVE-2021-27291 USN-4897-1
UbuntuPro:14.04:LTSpygments1.6+dfsg-1ubuntu1.1+esm1UBUNTU-CVE-2021-27291 USN-4897-2
Red Hatansible_automation_platform:4.2::el7automation-hub, python-galaxy-ng, python3-galaxy-ng0:4.2.2-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-bleach, python3-bleach0:3.3.0-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-bleach-allowlist, python3-bleach-allowlist0:1.0.3-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-galaxy-importer, python3-galaxy-importer0:0.2.15-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python-pulp-ansible, python3-pulp-ansible1:0.5.6-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el7python3-django0:2.2.18-1.el7pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8automation-hub, python-galaxy-ng, python3-galaxy-ng0:4.2.2-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-bleach, python3-bleach0:3.3.0-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-bleach-allowlist, python3-bleach-allowlist0:1.0.3-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-galaxy-importer, python3-galaxy-importer0:0.2.15-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python-pulp-ansible, python3-pulp-ansible1:0.5.6-1.el8pcRHSA-2021:0781
Red Hatansible_automation_platform:4.2::el8python3-django0:2.2.18-1.el8pcRHSA-2021:0781
59 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 4 morepython-Pygments2.6.1-7.10.1SUSE-SU-2021:3840-1
SUSELinux Enterprise High Performance Computing 15-ESPOS, Linux Enterprise High Performance Computing 15-LTSS, Linux Enterprise Module for Package Hub 15 SP2 and 3 morepython-Pygments2.2.0-4.9.1SUSE-SU-2021:3841-1
SUSELinux Enterprise Module for Basesystem 15 SP3python-Pygments2.6.1-4.3.1SUSE-SU-2021:3839-1
SUSELinux Enterprise Module for Public Cloud 12python-Pygments2.4.2-10.7.1SUSE-SU-2021:3814-1
openSUSELeap 15.2python-Pygments2.6.1-lp152.5.12.1openSUSE-SU-2021:1521-1
openSUSELeap 15.3python-Pygments2.2.0-4.9.1openSUSE-SU-2021:3841-1
openSUSELeap 15.3python-Pygments2.6.1-4.3.1openSUSE-SU-2021:3839-1
AlmaLinux8babel, python2-babel2.5.1-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python-nose-docs1.3.7-31.module_el8.5.0+2569+5c5719bcALSA-2021:4151
AlmaLinux8python-nose-docs1.3.7-31.module_el8.6.0+2781+fed64c13ALSA-2021:4150
AlmaLinux8python-sqlalchemy-doc1.3.2-2.module_el8.5.0+2569+5c5719bcALSA-2021:4151
AlmaLinux8python-sqlalchemy-doc1.3.2-2.module_el8.6.0+2781+fed64c13ALSA-2021:4150
AlmaLinux8python2-Cython0.28.1-7.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-PyMySQL0.8.0-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-attrs17.4.0-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-backports1.0-16.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-backports-ssl_match_hostname3.5.0.1-12.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-bson, python2-pymongo, python2-pymongo-gridfs3.7.0-1.module_el8.6.0+2781+fed64c13ALSA-2021:4151
AlmaLinux8python2-chardet3.0.4-10.module_el8.6.0+2781+fed64c13ALSA-2021:4151
56 more for AlmaLinux in the JSON.
Rocky Linux8Cython0:0.28.1-7.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8Cython0:0.28.1-7.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8PyYAML0:3.12-16.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8PyYAML0:3.12-16.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8babel0:2.5.1-10.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8numpy1:1.14.2-16.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8numpy1:1.14.2-16.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8pytest0:3.4.2-13.module+el8.4.0+403+9ae17a31RLSA-2021:4151
Rocky Linux8pytest0:3.4.2-13.module+el8.5.0+706+735ec4b3RLSA-2021:4151
Rocky Linux8python-PyMySQL0:0.10.1-2.module+el8.4.0+574+843c4898RLSA-2021:4150
Rocky Linux8python-PyMySQL0:0.10.1-2.module+el8.4.0+597+ddf0ddeaRLSA-2021:4150
Rocky Linux8python-PyMySQL0:0.8.0-10.module+el8.3.0+120+426d8bafRLSA-2021:4151
60 more for Rocky Linux in the JSON.
Alpinev3.11py3-pygments2.5.2-r1ALPINE-CVE-2021-27291
Alpinev3.12py3-pygments2.6.1-r1ALPINE-CVE-2021-27291
Azure Linux2python-pygments2.4.2-7AZL-6812
Azure Linux3python-pygments2.7.4-1AZL-35138

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Moderate.

ProductPackageStateAdvisory
Red Hat Automation Hub 4.2 for RHEL 7automation-hub-0:4.2.2-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python3-django-0:2.2.18-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-bleach-0:3.3.0-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-bleach-allowlist-0:1.0.3-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-galaxy-importer-0:0.2.15-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-galaxy-ng-0:4.2.2-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 7python-pulp-ansible-1:0.5.6-1.el7pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8automation-hub-0:4.2.2-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python3-django-0:2.2.18-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python-bleach-0:3.3.0-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python-bleach-allowlist-0:1.0.3-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python-galaxy-importer-0:0.2.15-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python-galaxy-ng-0:4.2.2-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8python-pulp-ansible-1:0.5.6-1.el8pcFixed 2021-03-09RHSA-2021:0781
Red Hat Enterprise Linux 8python36:3.6-8050020210811103506.982725abFixed 2021-11-09RHSA-2021:4150
Red Hat Enterprise Linux 8python27:2.7-8050020210811095446.3e7ace8bFixed 2021-11-09RHSA-2021:4151
Red Hat Enterprise Linux 6python-pygmentsOut of support scope
Red Hat Enterprise Linux 7python-pygmentsOut of support scope
Red Hat Enterprise Linux 7resource-agentsOut of support scope
Red Hat OpenStack Platform 10 (Newton)python-pygmentsOut of support scope
9 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2021-27291.

Attack patterns (CAPEC)

  • CAPEC-492 Regular Expression Exponential Blowup

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON