Skip to content

← Public intelligence

PyPI package

pygments

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

5 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Low, CVSS 1.9PyPIAmendedPublished

    Pygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching

    CVE-2026-4539 · GHSA-5239-wwwm-4pmq

    Affected
    • PyPI pygments < 2.20.0
    Fixed in
    2.20.0· Vendor fix available
    Issue
    A security flaw has been discovered in pygments before 2.20.0. The impacted element is the function AdlLexer of the file pygments/lexers/archetype.py. The manipulation results in inefficient regular expression complexity. The attack is only possible with local access. The exploit has been released to the public and may be used for attacks. The project was informed of the problem early through an issue report but has not responded yet.

    Recommended action: Upgrade to 2.20.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  2. Medium, CVSS 6.8PyPIAmendedPublished

    Pygments vulnerable to ReDoS

    CVE-2022-40896 · GHSA-mrwq-x4v8-fh7p

    Affected
    • PyPI pygments < 2.15.0
    Fixed in
    2.15.0· Vendor fix available
    Issue
    A ReDoS issue was discovered in pygments/lexers/smithy.py in Pygments until 2.15.0 via SmithyLexer.

    Recommended action: Upgrade to 2.15.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  3. Critical, CVSS 9.5PyPIAmendedPublished

    Command Injection in Pygments

    CVE-2015-8557 · GHSA-fff8-4w9p-7v76

    Affected
    • PyPI pygments >= 1.2.2, < 2.1
    Fixed in
    2.1· Vendor fix available
    Issue
    The FontManager.getnixfontpath function in formatters/img.py in Pygments 1.2.2 through 2.0.2 allows remote attackers to execute arbitrary commands via shell metacharacters in a font name.

    Recommended action: Upgrade to 2.1 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 8.7PyPIAmendedPublished

    Infinite Loop in Pygments

    CVE-2021-20270 · GHSA-9w8r-397f-prfh

    Affected
    • PyPI pygments >= 1.5, < 2.7.4
    Fixed in
    2.7.4· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 2.7.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  5. High, CVSS 8.7PyPIAmendedPublished

    Pygments vulnerable to Regular Expression Denial of Service (ReDoS)

    CVE-2021-27291 · GHSA-pq64-v7f5-gqh8

    Affected
    • PyPI pygments >= 1.1, < 2.7.4
    Fixed in
    2.7.4· Vendor fix available
    Issue
    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.

    Recommended action: Upgrade to 2.7.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →