pygments vulnerabilities

Pygments is a syntax highlighting package written in Python.

Registry
PyPI
Latest
2.21.0
License
BSD-2-Clause

5 known advisories

The latest version, 2.21.0, is not affected by any of them. Projects on older versions may be.

Update to the latest version:pip install 'pygments>=2.21.0'

Is your project on an affected pygments?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Security advisories for pygments

  • LowCVE-2026-4539GHSA-5239-wwwm-4pmq22 Mar 2026

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

    Affected
    <2.20.0
    Fixed in
    2.20.0
  • MediumCVE-2022-40896GHSA-mrwq-x4v8-fh7p19 Jul 2023

    Pygments vulnerable to ReDoS

    Affected
    <2.15.0
    Fixed in
    2.15.0
  • CriticalCVE-2015-8557GHSA-fff8-4w9p-7v7617 May 2022

    Command Injection in Pygments

    Affected
    >=1.2.2 <2.1
    Fixed in
    2.1
  • HighCVE-2021-20270GHSA-9w8r-397f-prfh20 Apr 2021

    Infinite Loop in Pygments

    Affected
    >=1.5 <2.7.4
    Fixed in
    2.7.4
  • HighCVE-2021-27291GHSA-pq64-v7f5-gqh829 Mar 2021

    Pygments vulnerable to Regular Expression Denial of Service (ReDoS)

    Affected
    >=1.1 <2.7.4
    Fixed in
    2.7.4

Is your pygments version vulnerable?

Which of your client projects still run an old pygments?

NPMscan reads the requirements.txt, poetry.lock, uv.lock and Pipfile.lock in every GitHub repo you pick and checks each installed version against these advisories, including the packages your packages pull in. Each finding comes with the command that fixes it.

Other PyPI packages

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily. Package details from the PyPI registry.