{"id":"CVE-2021-20270","aliases":["CVE-2021-20270","GHSA-9w8r-397f-prfh","PYSEC-2021-140"],"related":[],"kind":"vulnerability","state":"published","title":"Infinite Loop in Pygments","summary":"An infinite loop in SMLLexer in Pygments versions 1.5 to 2.7.3 may lead to denial of service when performing syntax highlighting of a Standard ML (SML) source file, as demonstrated by input that only contains the \"exception\" keyword.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"An infinite loop in SMLLexer in Pygments versions 1.5 to 2.7.3 may lead to denial of service when performing syntax highlighting of a Standard ML (SML) source file, as demonstrated by input that only contains the \"exception\" keyword.","source":"cvelist"},{"lang":"es","text":"Un bucle infinito en SMLLexer en Pygments versiones 1.5 hasta 2.7.3, puede conllevar a una denegación de servicio cuando se lleva a cabo el resaltado de sintaxis de un archivo fuente de Standard ML (SML), como es demostrado por la entrada que solo contiene la palabra clave \"exception\"","source":"nvd"}],"published":"2021-03-23T16:40:22.000Z","modified":"2026-06-17T03:33:34.817Z","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-835"],"affected":[{"ranges":[{"version":"python-pygments 2.7.4","status":"affected"}],"product":"python-pygments","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.5","status":"affected","fixed":"2.7.4"}],"ecosystem":"PyPI","package":"pygments","purl":"pkg:pypi/pygments","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.5","lastAffected":"2.7.3"}],"vendor":"pygments","product":"pygments","cpe":"cpe:2.3:a:pygments:pygments:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"3.11"},{"status":"affected","version":"4.0"}],"vendor":"redhat","product":"openshift_container_platform","cpe":"cpe:2.3:a:redhat:openshift_container_platform:3.11:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"redhat","product":"openstack_platform","cpe":"cpe:2.3:a:redhat:openstack_platform:10.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[],"vendor":"redhat","product":"software_collections","cpe":"cpe:2.3:a:redhat:software_collections:-:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"7.0"},{"status":"affected","version":"8.0"}],"vendor":"redhat","product":"enterprise_linux","cpe":"cpe:2.3:o:redhat:enterprise_linux:7.0:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"33"}],"vendor":"fedoraproject","product":"fedora","cpe":"cpe:2.3:o:fedoraproject:fedora:33:*:*:*:*:*:*:*","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":[{"type":"ecosystem","introduced":"1.5","status":"affected","fixed":"2.7.4"}],"ecosystem":"PyPI","package":"pygments","purl":"pkg:pypi/pygments","source":"pysec"}],"references":[{"url":"https://bugzilla.redhat.com/show_bug.cgi?id=1922136","tags":["issue-tracking","patch","report","third-party-advisory","web","x-refsource-misc","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.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://www.oracle.com/security-alerts/cpuoct2021.html","tags":["not-applicable","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-20270","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/pygments/pygments/commit/f91804ff4772e3ab41f46e28d370f57898700333","tags":["web"],"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-140.yaml","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/advisories/GHSA-9w8r-397f-prfh","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"redhat","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-20270","url":"https://www.cve.org/CVERecord?id=CVE-2021-20270","licence":"CVE Terms of Use","modified":"2024-08-03T17:37:23.034Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9w8r-397f-prfh","url":"https://github.com/advisories/GHSA-9w8r-397f-prfh","licence":"CC-BY-4.0","modified":"2024-10-14T18:43:36.784Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-20270","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-20270","licence":"Public domain","modified":"2026-06-17T03:33:34.817Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2021-140","url":"https://osv.dev/vulnerability/PYSEC-2021-140","licence":"CC-BY-4.0","modified":"2023-11-08T04:04:36.317Z"}],"updatedAt":"2026-11-25T22:58:00.394Z","epss":{"score":0.02492,"percentile":0.85103,"date":"2026-12-01T12:00:22.000Z"}}