{"id":"CVE-2021-27291","aliases":["CVE-2021-27291","GHSA-pq64-v7f5-gqh8","PYSEC-2021-141"],"related":[],"kind":"vulnerability","state":"published","title":"Pygments vulnerable to Regular Expression Denial of Service (ReDoS)","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"es","text":"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.&#xa0;Algunas de las expresiones regulares presentan una complejidad exponencial o cúbica en el peor de los casos y son vulnerables a ReDoS.&#xa0;Al diseñar una entrada maliciosa, un atacante puede causar una denegación de servicio","source":"nvd"}],"published":"2021-03-17T12:31:15.000Z","modified":"2026-06-17T03:44:37.283Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:N/A:P","score":5,"rating":"MEDIUM"}],"cwes":["CWE-400","CWE-1333"],"affected":[{"ranges":[{"version":"n/a","status":"affected"}],"source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.1","status":"affected","fixed":"2.7.4"}],"ecosystem":"PyPI","package":"pygments","purl":"pkg:pypi/pygments","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.1","fixed":"2.7.4"}],"vendor":"pygments","product":"pygments","cpe":"cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"9.0"},{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:9.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"32"},{"status":"affected","version":"33"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:32:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"git","introduced":"0","status":"affected","fixed":"2e7e8c4a7b318f4032493773732754e418279a14"},{"type":"ecosystem","introduced":"1.1","status":"affected","fixed":"2.7.4"}],"ecosystem":"PyPI","package":"pygments","purl":"pkg:pypi/pygments","repo":"https://github.com/pygments/pygments","source":"pysec"}],"references":[{"url":"https://gist.github.com/b-c-ds/b1a2cc0c68a35c57188575eb496de5ce","tags":["exploit","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14","tags":["fix","patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00024.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.debian.org/security/2021/dsa-4878","tags":["advisory","third-party-advisory","vendor-advisory","web","x-refsource-debian","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://www.debian.org/security/2021/dsa-4889","tags":["advisory","third-party-advisory","vendor-advisory","web","x-refsource-debian","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00003.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ/","tags":["vendor-advisory","x-refsource-fedora","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00006.html","tags":["mailing-list","third-party-advisory","web","x-refsource-mlist","x-transferred"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-27291","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pygments/pygments","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/pypa/advisory-database/tree/main/vulns/pygments/PYSEC-2021-141.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ","tags":["web"],"sources":["ghsa"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ/","tags":["web"],"sources":["pysec"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55/","tags":["web"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-pq64-v7f5-gqh8","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"mitre","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-27291","url":"https://www.cve.org/CVERecord?id=CVE-2021-27291","licence":"CVE Terms of Use","modified":"2024-08-03T20:48:16.368Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-pq64-v7f5-gqh8","url":"https://github.com/advisories/GHSA-pq64-v7f5-gqh8","licence":"CC-BY-4.0","modified":"2024-10-14T18:40:16.220Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-27291","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-27291","licence":"Public domain","modified":"2026-06-17T03:44:37.283Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-141","url":"https://osv.dev/vulnerability/PYSEC-2021-141","licence":"CC-BY-4.0","modified":"2023-11-08T04:05:24.065Z"}],"updatedAt":"2026-11-25T22:58:00.310Z","epss":{"score":0.03906,"percentile":0.90541,"date":"2026-12-01T12:00:22.000Z"}}