cve.bz

CVE-2021-20270 Infinite Loop

7.5 highEPSS 2.8%Fix available

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

On this page
An 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 Standard ML (SML) source file, as demonstrated by input that only contains the "exception" keyword.

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
2.8% (unchanged from 2.8% a week ago; 2.8% 30 days ago) estimated probability of exploitation activity in the next 30 days; 87th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CWE
CWE-835 Loop with Unreachable Exit Condition (Infinite Loop)
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-20270 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2021-20270?via=ask-ai-copy and https://cve.bz/cve/CVE-2021-20270?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-20270 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.5 through 2.7.3
redhat:openshift_container_platform3.11
redhat:openshift_container_platform4.0
redhat:openstack_platform10.0
redhat:enterprise_linux7.0
redhat:enterprise_linux8.0
fedoraproject:fedora33
debian:debian_linux9.0
debian:debian_linux10.0

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-9w8r-397f-prfhPyPIpygments>=1.5 <2.7.42.7.4
PYSEC-2021-140PyPIpygments>=1.5 <2.7.42.7.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9mediawiki1:1.27.7-1~deb9u8DLA-2648-1
Debian9pygments2.2.0+dfsg-1+deb9u1DLA-2590-1
Debian10mediawiki1:1.31.14-1~deb10u1DSA-4889-1
Debian10pygments2.3.1+dfsg-1+deb10u1DSA-4870-1
Debian12, 13, 14mediawiki1:1.35.2-1DEBIAN-CVE-2021-20270
Debian12, 13, 14pygments2.7.1+dfsg-2DEBIAN-CVE-2021-20270
Ubuntu16.04:LTSpygments2.1+dfsg-1ubuntu0.1UBUNTU-CVE-2021-20270 USN-4885-1
Ubuntu18.04:LTSpygments2.2.0+dfsg-1ubuntu0.1UBUNTU-CVE-2021-20270 USN-4885-1
Ubuntu20.04:LTSpygments2.3.1+dfsg-1ubuntu2.1UBUNTU-CVE-2021-20270 USN-4885-1
UbuntuPro:14.04:LTSpygments1.6+dfsg-1ubuntu1.1+esm1UBUNTU-CVE-2021-20270 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.7.1SUSE-SU-2021:3473-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.6.1SUSE-SU-2021:1500-1
openSUSELeap 15.2python-Pygments2.6.1-lp152.5.9.1openSUSE-SU-2021:1402-1
openSUSETumbleweedpython-Pygments2.21.0-1.1openSUSE-SU-2026:11568-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.14, v3.15, v3.16 and 8 morepy3-pygments2.7.4-r0ALPINE-CVE-2021-20270
Azure Linux2python-pygments2.4.2-7AZL-6811
Azure Linux3python-pygments2.7.4-1AZL-35137

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.

Red Hat's statement

In OpenShift Container Platform 3.11, the vulnerable version of python-pygments is embedded in the google-cloud-sdk package, which is shipped in the openshift-ansible container (aos3-installation-container). As the access to the openshift-ansible container is restricted only to cluster administrators, this component is affected but with a Low impact. The google-cloud-sdk package was shipped in OpenShift Container Platform 4.1, which is End of Life.

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 Enterprise Linux 6python-pygmentsNot affected
Red Hat Enterprise Linux 7python-pygmentsNot affected
Red Hat Enterprise Linux 7resource-agentsOut of support scope
Red Hat Enterprise Linux 9python-pygmentsNot affected
Red Hat OpenShift Container Platform 3.11google-cloud-sdkFix deferred
Red Hat OpenShift Container Platform 4google-cloud-sdkOut of support scope
Red Hat OpenStack Platform 10 (Newton)python-pygmentsOut of support scope
12 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-20270.

References

Check your stackJSON