CVE-2021-20270
Python vulnerability analysis and mitigation

Overview

CVE-2021-20270 affects Pygments versions 1.5 to 2.7.3, where an infinite loop vulnerability exists in the SMLLexer component. The vulnerability was discovered in December 2020 and publicly disclosed in March 2021. The issue affects systems using Pygments for syntax highlighting of Standard ML (SML) source files (NVD, CVE).

Technical details

The vulnerability occurs in the SMLLexer component when processing Standard ML source files. Specifically, the infinite loop is triggered when the lexer encounters input that contains only the "exception" keyword. The SMLLexer component was introduced in Pygments version 1.5, making versions prior to this unaffected (Red Hat Bugzilla).

Impact

When successfully exploited, this vulnerability can lead to a denial of service condition when performing syntax highlighting operations. The impact is primarily on system availability, as the infinite loop consumes system resources (NVD).

Mitigation and workarounds

The vulnerability has been fixed in versions after 2.7.3. Users should upgrade to a patched version of Pygments. The fix was implemented in an upstream patch that addresses the infinite loop condition in the SMLLexer component (Red Hat Bugzilla).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-66423HIGH7.1
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-66454MEDIUM6.5
  • PythonPython
  • arcade-mcp-server
NoYesDec 02, 2025
CVE-2025-66424MEDIUM6.5
  • PythonPython
  • trytond
NoYesNov 30, 2025
CVE-2025-66422MEDIUM4.3
  • PythonPython
  • tryton-server
NoYesNov 30, 2025
CVE-2025-65858LOW3.5
  • PythonPython
  • calibreweb
NoNoDec 02, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management