Advisory

GHSA-pq64-v7f5-gqh8

Also known as: CVE-2021-27291, PYSEC-2021-141

Summary

Pygments vulnerable to Regular Expression Denial of Service (ReDoS)

Details

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.

Severity

High Basis: The source's own band: HIGH

Dates

Published
2021-03-29 16:33 UTC
Modified
2024-10-14 18:40 UTC

Affected packages and fixes

pygments

PyPI · All systems

Affected

  • introduced 1.1, fixed 2.7.4 (ecosystem)

Fixed versions

2.7.4

Fix

  • Fixed version 2.7.4
    pip install --upgrade pygments==2.7.4

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0

Sources & licences