7.5high
Pygments vulnerable to Regular Expression Denial of Service (ReDoS)
- Severity
- 7.5high CVSS:3.1 by NVD
- Exploit likelihood
- 3.91% (higher than 90% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-pq64-v7f5-gqh8PYSEC-2021-141
Description
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.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| pygments (PyPI) | from 1.1 before 2.7.4, before 2e7e8c4a7b318f4032493773732754e418279a14 | GitHub Advisory Database, PyPA Advisory Database |
| pygments pygments | from 1.1 before 2.7.4 | NVD |
| debian debian_linux | 9.0, 10.0 | NVD |
| fedoraproject fedora | 32, 33 | NVD |
All scores
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | high CVSS:4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 5.0medium CVSS:2.0 | AV:N/AC:L/Au:N/C:N/I:N/A:P |
Classification
What each source says
CVE List
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.
NVD (es)
En pygments versión 1.1+, corregido en 2.7.4, los lexers usados para analizar unos lenguajes de programación dependen en gran medida en expresiones regulares. Algunas de las expresiones regulares presentan una complejidad exponencial o cúbica en el peor de los casos y son vulnerables a ReDoS. Al diseñar una entrada maliciosa, un atacante puede causar una denegación de servicio
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-27291 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-pq64-v7f5-gqh8 changed 2024-10-14 | CC-BY-4.0 |
| NVD | CVE-2021-27291 changed 2026-06-17 | Public domain |
| PyPA Advisory Database | PYSEC-2021-141 changed 2023-11-08 | CC-BY-4.0 |