Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. Pygments
  4. ›
  5. CVE-2021-20270

CVE-2021-20270: Infinite Loop in Pygments

April 20, 2021 (updated October 14, 2024)

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.

References

  • bugzilla.redhat.com/show_bug.cgi?id=1922136
  • github.com/advisories/GHSA-9w8r-397f-prfh
  • github.com/pygments/pygments
  • github.com/pygments/pygments/commit/f91804ff4772e3ab41f46e28d370f57898700333
  • github.com/pypa/advisory-database/tree/main/vulns/pygments/PYSEC-2021-140.yaml
  • lists.debian.org/debian-lts-announce/2021/05/msg00003.html
  • lists.debian.org/debian-lts-announce/2021/05/msg00006.html
  • nvd.nist.gov/vuln/detail/CVE-2021-20270
  • www.debian.org/security/2021/dsa-4889
  • www.oracle.com/security-alerts/cpuoct2021.html

Code Behaviors & Features

Detect and mitigate CVE-2021-20270 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions starting from 1.5 before 2.7.4

Fixed versions

  • 2.7.4

Solution

Upgrade to version 2.7.4 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')

Source file

pypi/Pygments/CVE-2021-20270.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:40 +0000.