Read the docs
TI-2021-03561 Aliases CVE-2021-20270GHSA-9w8r-397f-prfh

Infinite loop in python-pygments

Priority LOW 38CWE-835Published · 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, 4 without a fix

Attack profile from CVSS 3.1 · NVD. Fix status from CNA, GitHub and Red Hat. Impact type from CWE-835.

Summary

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.

Why it matters now

EPSS 0.02759 86th percentileScored 2026-11-07
Fix Partial Pygments (PyPI): 2.7.4Red Hat: 5 advisoriesRed Hat: 8 fixed, 4 without a fix

SSVC decision points

Not available: CISA has not published SSVC decision points for this record.

Affected products

VendorProductAffected versionsFixed inStatusSource
—python-pygmentspython-pygments 2.7.4—No fix listedCNA
—Pygments (PyPI)1.5 to before 2.7.42.7.4Patch availableGHSA-9w8r-397f-prfh
  • python-pygments Vendor— Affected python-pygments 2.7.4 Fixed in — No fix listed CNA
  • Pygments (PyPI) Vendor— Affected 1.5 to before 2.7.4 Fixed in 2.7.4 Patch available GHSA-9w8r-397f-prfh

CPE configurations NVD · 10

CPEVersionsRoleVendor
cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:*1.5 – 2.7.3VulnerablePygments
cpe:2.3:a:redhat:openshift_container_platform:3.11:*:*:*:*:*:*:*3.11VulnerableRed Hat
cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:*4.0VulnerableRed Hat
cpe:2.3:a:redhat:openstack_platform:10.0:*:*:*:*:*:*:*10.0VulnerableRed Hat
cpe:2.3:a:redhat:software_collections:-:*:*:*:*:*:*:*not specified by NVDVulnerableRed Hat
cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*7.0VulnerableRed Hat
cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:*8.0VulnerableRed Hat
cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*33VulnerableFedoraproject
cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*9.0VulnerableDebian
cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*10.0VulnerableDebian
  • cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:* Versions 1.5 – 2.7.3 Vulnerable ·Pygments
  • cpe:2.3:a:redhat:openshift_container_platform:3.11:*:*:*:*:*:*:* Versions 3.11 Vulnerable ·Red Hat
  • cpe:2.3:a:redhat:openshift_container_platform:4.0:*:*:*:*:*:*:* Versions 4.0 Vulnerable ·Red Hat
  • cpe:2.3:a:redhat:openstack_platform:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Red Hat
  • cpe:2.3:a:redhat:software_collections:-:*:*:*:*:*:*:* Versions not specified by NVD Vulnerable ·Red Hat
  • cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:* Versions 7.0 Vulnerable ·Red Hat
  • cpe:2.3:o:redhat:enterprise_linux:8.0:*:*:*:*:*:*:* Versions 8.0 Vulnerable ·Red Hat
  • cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:* Versions 33 Vulnerable ·Fedoraproject
  • 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

Remediation

  • Fix · GHSA-9w8r-397f-prfh Pygments (PyPI) Fixed in 2.7.4 Advisory →

Red Hat 5 advisories

  • RHSA-2021:4150 Released 2021-11-09 · Red Hat rating Moderate
    python36: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 Moderate
    python27: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 Moderate
    resource-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 Moderate
    python27 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 Moderate
    Red 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 →

ProductStatusPlan or fix
Red Hat Enterprise Linux 7AffectedNo fix planned: Out of support scope
Red Hat OpenShift Container Platform 3.11AffectedNo fix yet: Fix deferred
Red Hat OpenShift Container Platform 4AffectedNo fix planned: Out of support scope
Red Hat OpenStack Platform 10 (Newton)AffectedNo fix planned: Out of support scope
Red Hat Automation Hub 4.2 for RHEL 7Fixed RHSA-2021:0781
Red Hat Automation Hub 4.2 for RHEL 8Fixed 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
Not affected: 3 products
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 9

Timeline

  1. 2026-10-02 Threatist record created from CVE-2021-20270
  2. 2026-10-03 Alias added: GHSA-9w8r-397f-prfh

References

Sources