ADVISORIES

Vulnerability

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.

38 advisories report this vulnerability, across 13 ecosystems.

Advisories

  • ALAS2-2023-2117

    Amazon Linux 2 2017.12 - ALAS2-2023-2117: medium priority package update for python3-pygments

    Medium CVE-2021-27291 Amazon Linux Updated 19 July 2023
  • ALAS2-2023-2198

    Amazon Linux 2 2017.12 - ALAS2-2023-2198: medium priority package update for python-pygments

    Medium CVE-2021-27291 Amazon Linux Updated 8 August 2023
  • ALPINE-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…

    CVE-2021-27291 Alpine Updated 23 October 2026
  • ALSA-2021:4139

    Moderate: resource-agents security, bug fix, and enhancement update

    CVE-2021-20270CVE-2021-27291 AlmaLinux Updated 29 October 2026
  • ALSA-2021:4150

    Moderate: python36:3.6 security and bug fix update

    CVE-2021-20270CVE-2021-27291 AlmaLinux Updated 2 November 2026
  • ALSA-2021:4151

    Moderate: python27:2.7 security update

    CVE-2020-27619CVE-2020-28493CVE-2021-20095CVE-2021-20270 AlmaLinux Updated 29 October 2026
  • AZL-35138

    CVE-2021-27291 affecting package python-pygments for versions less than 2.7.4-1

    CVE-2021-27291 Azure Linux Updated 21 April 2026
  • AZL-6812

    CVE-2021-27291 affecting package python-pygments for versions less than 2.4.2-7

    CVE-2021-27291 Azure Linux Updated 21 April 2026
  • DEBIAN-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…

    CVE-2021-27291 Debian Updated 23 October 2026
  • DLA-2600-1

    pygments - security update

    CVE-2021-27291 Debian Updated 20 November 2026
  • DLA-2648-1

    mediawiki - security update

    CVE-2021-20270CVE-2021-27291CVE-2021-30152CVE-2021-30155 Debian Updated 20 November 2026
  • DSA-4878-1

    pygments - security update

    CVE-2021-27291 Debian Updated 20 November 2026
  • DSA-4889-1

    mediawiki - security update

    CVE-2021-20270CVE-2021-27291CVE-2021-30152CVE-2021-30154 Debian Updated 20 November 2026
  • ELSA-2021-4150

    ELSA-2021-4150: python36:3.6 security and bug fix update (MODERATE)

    Moderate CVE-2021-20270CVE-2021-27291 Oracle Linux Updated 16 November 2021
  • ELSA-2021-4151

    ELSA-2021-4151: python27:2.7 security update (MODERATE)

    Moderate CVE-2020-27619CVE-2020-28493CVE-2021-20095CVE-2021-20270 Oracle Linux Updated 16 November 2021
  • ELSA-2021-9553

    ELSA-2021-9553: resource-agents security update (MODERATE)

    Moderate CVE-2021-20270CVE-2021-27291 Oracle Linux Updated 19 November 2021
  • GHSA-pq64-v7f5-gqh8

    Pygments vulnerable to Regular Expression Denial of Service (ReDoS)

    High CVE-2021-27291 PyPI Updated 14 October 2024
  • OESA-2021-1154

    python-pygments security update

    High CVE-2021-20270CVE-2021-27291 openEuler Updated 18 August 2026
  • PYSEC-2021-141

    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…

    CVE-2021-27291 PyPI Updated 8 November 2023
  • RHSA-2021:0781

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

    CVE-2020-15366CVE-2020-7789CVE-2021-20270CVE-2021-23980 Red Hat Updated 23 November 2026
  • RHSA-2021:3252

    Red Hat Security Advisory: python27 security update

    CVE-2020-27619CVE-2020-28493CVE-2021-20095CVE-2021-20270 Red Hat Updated 23 November 2026
  • RHSA-2021:4139

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

    CVE-2021-20270CVE-2021-27291 Red Hat Updated 13 November 2026
  • RHSA-2021:4150

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

    CVE-2021-20270CVE-2021-27291 Red Hat Updated 13 November 2026
  • RHSA-2021:4151

    Red Hat Security Advisory: python27:2.7 security update

    CVE-2020-27619CVE-2020-28493CVE-2021-20095CVE-2021-20270 Red Hat Updated 23 November 2026
  • RHVEX-CVE-2021-27291

    python-pygments: ReDoS in multiple lexers

    Moderate CVE-2021-27291 Red Hat Updated 7 November 2026
  • RLSA-2021:4139

    Moderate: resource-agents security, bug fix, and enhancement update

    CVE-2021-20270CVE-2021-27291 Rocky Linux Updated 4 February 2026
  • RLSA-2021:4150

    Moderate: python36:3.6 security and bug fix update

    CVE-2021-20270CVE-2021-27291 Rocky Linux Updated 5 February 2026
  • RLSA-2021:4151

    Moderate: python27:2.7 security update

    CVE-2020-27619CVE-2020-28493CVE-2021-20095CVE-2021-20270 Rocky Linux Updated 4 February 2026
  • SUSE-SU-2021:3814-1

    Security update for python-Pygments

    CVE-2021-27291 SUSE Updated 4 February 2026
  • SUSE-SU-2021:3839-1

    Security update for python-Pygments

    CVE-2021-27291 SUSE Updated 2 May 2025
  • SUSE-SU-2021:3840-1

    Security update for python-Pygments

    CVE-2021-27291 SUSE Updated 4 February 2026
  • SUSE-SU-2021:3841-1

    Security update for python-Pygments

    CVE-2021-27291 SUSE Updated 4 February 2026
  • UBUNTU-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…

    CVE-2021-27291 Ubuntu Updated 17 October 2026
  • USN-4897-1

    pygments vulnerability

    CVE-2021-27291 Ubuntu Updated 27 April 2026
  • USN-4897-2

    pygments vulnerabilities

    CVE-2021-20270CVE-2021-27291 Ubuntu Updated 29 June 2026
  • openSUSE-SU-2021:1521-1

    Security update for python-Pygments

    CVE-2021-27291 openSUSE Updated 4 February 2026
  • openSUSE-SU-2021:3839-1

    Security update for python-Pygments

    CVE-2021-27291 openSUSE Updated 4 February 2026
  • openSUSE-SU-2021:3841-1

    Security update for python-Pygments

    CVE-2021-27291 openSUSE Updated 4 February 2026

References