CVE-2026-4539: Pygments Denial of Service Vulnerability
LOWCVE-2026-4539 is a LOW (CVSS 3.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting Pygments libraries in the PyPI ecosystem. The issue involves pygments has regular expression denial of service (redos) due to inefficient regex for guid matching. Remediation is available by upgrading affected packages to version 2.20.0.
CVE-2026-4539 at a Glance
Security Impact
CVSS: 3.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L).
How to Fix CVE-2026-4539
To remediate this vulnerability, upgrade all affected Pygments dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install Pygments>=2.20.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show Pygments
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-4539, inspect your installed packages using pip:
pip show Pygments
Analyze the terminal output to locate any version of Pygments in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.20.0), your application is affected.
Note: The pip show Pygments command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In Pygments, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-4539 Affected Pygments Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
Pygments
|
PyPI |
< 2.20.0
|
2.20.0
|
References
Frequently Asked Questions
What is CVE-2026-4539?
Which Pygments versions are affected?
What version fixes CVE-2026-4539?
Is Pygments affected?
What is the CVSS score of CVE-2026-4539?
What CWE is associated with CVE-2026-4539?
How can I check PyPI dependencies for CVE-2026-4539?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-5239-wwwm-4pmq",
"modified" : "2026-03-30T14:40:28Z",
"published" : "2026-03-22T06:30:15Z",
"aliases" : [ "CVE-2026-4539" ],
"summary" : "Pygments has Regular Expression Denial of Service (ReDoS) due to Inefficient Regex for GUID Matching",
"details" : "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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "Pygments"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.20.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-4539"
}, {
"type" : "WEB",
"url" : "https://github.com/pygments/pygments/issues/3058"
}, {
"type" : "WEB",
"url" : "https://github.com/pygments/pygments/pull/3064"
}, {
"type" : "WEB",
"url" : "https://github.com/pygments/pygments/commit/24b8aa76c6cd6d70f39c6dd605cce319c98e2ccc"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/pygments/pygments"
}, {
"type" : "WEB",
"url" : "https://github.com/pygments/pygments/releases/tag/2.20.0"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?ctiid.352327"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?id.352327"
}, {
"type" : "WEB",
"url" : "https://vuldb.com/?submit.774685"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1333", "CWE-400" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-24T20:33:39Z",
"nvd_published_at" : "2026-03-22T06:16:20Z"
}
}