CVE-2021-27291
Pygments vulnerability
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.
Affected products
Pygments, Debian Linux, Fedora. The exact versions are in the references.
What to do now
- Check your exposureFind out whether Pygments runs anywhere in your environment, including systems of suppliers.
- UpdateInstall the version in which the vendor fixed the vulnerability. The references lead to the advisory.
- Limit access until thenIf you cannot update at once, take the system off the internet or restrict who can reach it.
References
- github.com/pygments/pygments/commit/2e7e8c4a7b318f4032493773732754e418279a14 · Patch
- gist.github.com/b-c-ds/b1a2cc0c68a35c57188575eb496de5ce · Exploit
- lists.debian.org/debian-lts-announce/2021/03/msg00024.html · Third Party Advisory
- lists.debian.org/debian-lts-announce/2021/05/msg00003.html · Third Party Advisory
- lists.debian.org/debian-lts-announce/2021/05/msg00006.html · Third Party Advisory
- www.debian.org/security/2021/dsa-4878 · Third Party Advisory
- www.debian.org/security/2021/dsa-4889 · Third Party Advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/G
- nvd.nist.gov/vuln/detail/CVE-2021-27291
- cve.org/CVERecord?id=CVE-2021-27291
Data: CVE list and the NVD. This product uses data from the NVD API but is not endorsed or certified by the NVD.