CVE-2021-20270 Infinite Loop in Pygments
An infinite loop in Pygments allows attackers to cause denial of service via crafted Standard ML source files during syntax highlighting.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2021-20270?
CVE-2021-20270 is a high-severity denial of service vulnerability in Debian Debian Linux, published on 23 Mar 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Official description
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.
Weakness: CWE-835
Which versions are affected by CVE-2021-20270?
3 open source packages ship an affected version, including pygments and Pygments. It affects 7 products.
| Package | Affected | Fixed in |
|---|---|---|
pygments PyPI | From 1.5 | 2.7.4 |
pygments PyPI | From 1.5 | 2.7.4 |
Pygments PyPI | From 1.5 | 2.7.4 |
Linux distribution packages (15)
python-Pygments SUSE:Enterprise Storage 6 | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise High Performance Computing 15 SP1-ESPOS | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise High Performance Computing 15 SP1-LTSS | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise High Performance Computing 15-ESPOS | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise High Performance Computing 15-LTSS | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise Module for Basesystem 15 SP2 | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise Module for Package Hub 15 SP2 | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise Module for Package Hub 15 SP3 | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise Server 15 SP1-BCL | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise Server 15 SP1-LTSS | All versions | 2.6.1-7.7.1 |
python-Pygments SUSE:Linux Enterprise Server 15-LTSS | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise Server for SAP Applications 15 | All versions | 2.2.0-4.6.1 |
python-Pygments SUSE:Linux Enterprise Server for SAP Applications 15 SP1 | All versions | 2.6.1-7.7.1 |
python-Pygments openSUSE:Leap 15.2 | All versions | 2.6.1-lp152.5.9.1 |
python-Pygments openSUSE:Tumbleweed | All versions | 2.21.0-1.1 |
Products include Debian Debian Linux, Fedoraproject Fedora, Pygments Pygments, Redhat Enterprise Linux, Redhat Openshift Container Platform, Redhat Openstack Platform and 1 more.
How do I fix CVE-2021-20270?
Upgrade pygments to 2.7.4 or later.
Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.
Is CVE-2021-20270 being exploited?
There is no known exploitation of CVE-2021-20270 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as ALPINE-CVE-2021-20270, AZL-35137, AZL-6811, DEBIAN-CVE-2021-20270, DLA-2590-1, DSA-4870-1 and 10 more.