Skip to content
OpenAdvisories
High USN-4897-2 2 CVEs

pygments vulnerabilities

Published Aug 14, 2023 · Updated Jun 29, 2026

Summary

USN-4897-1 fixed several vulnerabilities in Pygments. This update provides
the corresponding update for Ubuntu 14.04 LTS.

Original advisory details:

Ben Caller discovered that Pygments incorrectly handled parsing certain
files. If a user or automated system were tricked into parsing a specially
crafted file, a remote attacker could cause Pygments to hang or consume
resources, resulting in a denial of service. (CVE-2021-27291)

It was discovered that Pygments incorrectly handled parsing certain
files. An attacker could possibly use this issue to cause a denial of
service. (CVE-2021-20270)

Fixed packages 1

ReleasePackageFixed in
Ubuntu · Pro 14.04 LTS Pro:14.04:LTS pygments 1.6+dfsg-1ubuntu1.1+esm1

Vulnerabilities 2

  • High 7.5

    Infinite Loop in Pygments

    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.

  • High 7.5

    Pygments vulnerable to Regular Expression Denial of Service (ReDoS)

    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 …

References

  • report
    https://ubuntu.com/security/CVE-2021-20270
  • report
    https://ubuntu.com/security/CVE-2021-27291