{"id":"CVE-2021-27291","aliases":["GHSA-pq64-v7f5-gqh8","PYSEC-2021-141"],"url":"https://o3.security/vulnerability/CVE-2021-27291","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.","published":"2021-03-17T13:15:15.137Z","modified":"2026-08-07T11:31:23.744982291Z","cvss":{"score":7.5,"severity":"HIGH","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"PyPI","name":"pygments","fixedVersion":"2.7.4"}],"fix":{"url":"https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14","label":"pygments/pygments@2e7e8c4"},"references":[{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55/"},{"type":"WEB","url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ/"},{"type":"ADVISORY","url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00024.html"},{"type":"ADVISORY","url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00003.html"},{"type":"ADVISORY","url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00006.html"},{"type":"ADVISORY","url":"https://www.debian.org/security/2021/dsa-4878"},{"type":"ADVISORY","url":"https://www.debian.org/security/2021/dsa-4889"},{"type":"FIX","url":"https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14"},{"type":"EVIDENCE","url":"https://gist.github.com/b-c-ds/b1a2cc0c68a35c57188575eb496de5ce"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-07T11:31:23.744982291Z"}}