{"id":"UBUNTU-CVE-2021-20270","details":"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.","modified":"2026-01-30T00:55:41.771188Z","published":"2021-03-09T00:00:00Z","related":["USN-4885-1","USN-4897-2"],"upstream":["CVE-2021-20270"],"references":[{"type":"REPORT","url":"https://ubuntu.com/security/CVE-2021-20270"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-4885-1"},{"type":"ADVISORY","url":"https://ubuntu.com/security/notices/USN-4897-2"},{"type":"REPORT","url":"https://www.cve.org/CVERecord?id=CVE-2021-20270"}],"affected":[{"package":{"name":"pygments","ecosystem":"Ubuntu:Pro:14.04:LTS","purl":"pkg:deb/ubuntu/pygments@1.6+dfsg-1ubuntu1.1+esm1?arch=source&distro=trusty/esm"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.6+dfsg-1ubuntu1.1+esm1"}]}],"versions":["1.6+dfsg-1","1.6+dfsg-1build1","1.6+dfsg-1ubuntu1","1.6+dfsg-1ubuntu1.1"],"ecosystem_specific":{"availability":"Available with Ubuntu Pro (Infra-only): https://ubuntu.com/pro","binaries":[{"binary_name":"python-pygments","binary_version":"1.6+dfsg-1ubuntu1.1+esm1"},{"binary_name":"python3-pygments","binary_version":"1.6+dfsg-1ubuntu1.1+esm1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-20270.json"}},{"package":{"name":"pygments","ecosystem":"Ubuntu:16.04:LTS","purl":"pkg:deb/ubuntu/pygments@2.1+dfsg-1ubuntu0.1?arch=source&distro=xenial"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.1+dfsg-1ubuntu0.1"}]}],"versions":["2.0.1+dfsg-1.1svn1","2.0.1+dfsg-1.1ubuntu1","2.1+dfsg-1"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-pygments","binary_version":"2.1+dfsg-1ubuntu0.1"},{"binary_name":"python3-pygments","binary_version":"2.1+dfsg-1ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-20270.json"}},{"package":{"name":"pygments","ecosystem":"Ubuntu:18.04:LTS","purl":"pkg:deb/ubuntu/pygments@2.2.0+dfsg-1ubuntu0.1?arch=source&distro=bionic"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.2.0+dfsg-1ubuntu0.1"}]}],"versions":["2.2.0+dfsg-1"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-pygments","binary_version":"2.2.0+dfsg-1ubuntu0.1"},{"binary_name":"python3-pygments","binary_version":"2.2.0+dfsg-1ubuntu0.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-20270.json"}},{"package":{"name":"pygments","ecosystem":"Ubuntu:20.04:LTS","purl":"pkg:deb/ubuntu/pygments@2.3.1+dfsg-1ubuntu2.1?arch=source&distro=focal"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.3.1+dfsg-1ubuntu2.1"}]}],"versions":["2.3.1+dfsg-1ubuntu1","2.3.1+dfsg-1ubuntu2"],"ecosystem_specific":{"availability":"No subscription required","binaries":[{"binary_name":"python-pygments","binary_version":"2.3.1+dfsg-1ubuntu2.1"},{"binary_name":"python3-pygments","binary_version":"2.3.1+dfsg-1ubuntu2.1"}]},"database_specific":{"source":"https://github.com/canonical/ubuntu-security-notices/blob/main/osv/cve/2021/UBUNTU-CVE-2021-20270.json"}}],"schema_version":"1.7.3","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},{"type":"Ubuntu","score":"medium"}]}