{"id":"CVE-2021-27291","published":"2021-03-17T12:31:15Z","modified":"2024-08-03T20:48:16Z","title":"In pygments 1.1+, fixed in 2.7.4, the lexers used to parse programming languages rely heavily on regular expressions","vendor":null,"product":null,"tier":"tail","description":{"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.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.03906,"percentile":0.90532,"provenance":"source"},"cwes":[],"references":[{"url":"https://gist.github.com/b-c-ds/b1a2cc0c68a35c57188575eb496de5ce","tags":["x_refsource_MISC"]},{"url":"https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14","tags":["x_refsource_MISC"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/03/msg00024.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://www.debian.org/security/2021/dsa-4878","tags":["vendor-advisory","x_refsource_DEBIAN"]},{"url":"https://www.debian.org/security/2021/dsa-4889","tags":["vendor-advisory","x_refsource_DEBIAN"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00003.html","tags":["mailing-list","x_refsource_MLIST"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/GSJRFHALQ7E3UV4FFMFU2YQ6LUDHAI55/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WSLD67LFGXOX2K5YNESSWAS4AGZIJTUQ/","tags":["vendor-advisory","x_refsource_FEDORA"]},{"url":"https://lists.debian.org/debian-lts-announce/2021/05/msg00006.html","tags":["mailing-list","x_refsource_MLIST"]}],"priority":{"score":18.1,"factors":[{"name":"EPSS percentile","points":18.11}]},"affected":[{"ecosystem":"PyPI","package":"Pygments","vulnerableRanges":[">=1.1, <2.7.4"],"patched":["2.7.4"],"from":["GHSA-pq64-v7f5-gqh8","PYSEC-2021-141"],"provenance":"source"}],"summary":{"text":"The flaw affects the lexers in Pygments, the Python syntax-highlighting library, from version 1.1 up to (but not including) 2.7.4, where several regular expressions used to parse programming languages have exponential or cubic worst-case complexity.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:25:58Z"},"euvd":{"id":"EUVD-2021-0208","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-pygments-cve-2021-27291","children":[{"from":"CVE-2021-27291","to":"CVE-2022-40896","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["pygments/lexers/templates.py"],"commits":["https://github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14","https://github.com/pygments/pygments/commit/97eb3d5ec7c1b3ea4fcf9dee30a2309cf92bd194","https://github.com/pygments/pygments/commit/dd52102c38ebe78cd57748e09f38929fd283ad04"],"basis":"rarely changed file"}]}]}}