CVE-2022-40896 json
Pygments vulnerable to ReDoS
published 2023-07-19 3 y ago modified 2026-06-17 4 mo ago also GHSA-mrwq-x4v8-fh7p , PYSEC-2023-117 , EUVD-2023-0215
- cvss
- 5.5
- version 3.1, NVD
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 0.5%
- EPSS 0.5% chance of exploitation in 30 days, percentile 44%
- public exploits
- 0
- none known
Summary
A ReDoS issue was discovered in pygments/lexers/smithy.py in pygments through 2.15.0 via SmithyLexer.
Patch / fix
- pypi pygments 2.15.0, 2.15.1
- pygments Debian 14, Debian 13 2.15.1+dfsg-1
debian advisories DEBIAN-CVE-2022-40896
- pygments Ubuntu 22.04 LTS 2.11.2+dfsg-2ubuntu0.1
ubuntu advisories UBUNTU-CVE-2022-40896
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- foreman satellite utils 6.15, satellite capsule 6.15, satellite 6.15 3.9.1.6-1.el8sat
- foreman-cli satellite utils 6.15, satellite 6.15 3.9.1.6-1.el8sat
- foreman-ec2 satellite 6.15 3.9.1.6-1.el8sat
- foreman-pcp satellite 6.15 3.9.1.6-1.el8sat
- puppetserver satellite capsule 6.15, satellite 6.15 7.14.0-1.el8sat
- rubygem-puma satellite 6.15 6.4.2-1.el8sat
- foreman-ovirt satellite 6.15 3.9.1.6-1.el8sat
- foreman-redis satellite 6.15 3.9.1.6-1.el8sat
red hat advisories RHSA-2024:2010RHSA-2024:1057
- python-pygments CBL-Mariner 2.0, Azure Linux 3.0 2.4.2-1
azure linux advisories AZL-27502AZL-35139
Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2022-40896 updated cvss 5.5
pygments: ReDoS in pygments
-
Red Hat Ansible Automation Platform 2 aap-cloud-metrics-collector-containeraffected: workaround, no fix planned “Will not fix”
-
Red Hat Enterprise Linux 6 python-pygments Red Hat Enterprise Linux 7 python-pygments, resource-agents, resource-agents-gcp, resource-agents-sap, sap-cluster-connector, resource-agents-aliyun, +2 moreaffected: workaround, no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 python3.11-pip, python-pygments, resource-agents, python2-pygments, python3-pygments, resource-agents-gcp, +3 moreaffected: workaround, no fix available, no fix planned “Will not fix”
-
Red Hat Enterprise Linux 9 python3.11-pip, python3.11-pip-wheelaffected: workaround, no fix planned “Will not fix”
-
Red Hat Ansible Automation Platform 2.4 for RHEL 8 python39-pygments 2.17.2-1.el8ap, python3x-pygments 2.17.2-1.el8ap, ansible-automation-platform-24/ee-supported-rhel8 1.0.0-572 Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-pygments 2.17.2-1.el9ap, python3-pygments 2.17.2-1.el9ap, ansible-automation-platform-24/ee-supported-rhel9 1.0.0-573fixed: vendor fix RHSA-2024:1057
-
Red Hat Satellite 6.15 for RHEL 8 python-pygments 2.17.0-1.el8pc, python3.11-pygments 2.17.0-1.el8pcfixed: vendor fix RHSA-2024:2010
-
Red Hat Ansible Automation Platform 2 ansible-lint, ansible-navigator, python-ansible-compat, python-django-lifecycle, python3x-ansible-compat, python3x-django-lifecycle, +6 more Red Hat Ansible Automation Platform 2.4 for RHEL 8 ansible-runner 2.3.5-1.el8ap, automation-hub 4.9.1-1.el8ap, ansible-builder 3.0.1-1.el8ap, ansible-dev-tools 2.4-1.el8ap, python39-jinja2 3.1.3-1.el8ap, python3x-jinja2 3.1.3-1.el8ap, +131 more Red Hat Ansible Automation Platform 2.4 for RHEL 9 python-jinja2 3.1.3-1.el9ap, ansible-runner 2.3.5-1.el9ap, automation-hub 4.9.1-1.el9ap, python-aiohttp 3.9.1-1.el9ap, python-boto3 1.18.35-4.el9ap, python-django 4.2.10-1.el9ap, +109 more Red Hat Developer Hub 1 rhdh/rhdh-hub-rhel9 Red Hat Satellite 6.15 for RHEL 8 cjson 1.7.14-5.el8sat, libsolv 0.7.22-6.el8pc, katello 4.11.0-1.el8sat, libcomps 0.1.18-8.el8pc, python-jq 1.6.0-3.el8pc, foreman 3.9.1.6-1.el8sat, +677 morenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
CISA SSVC
- Exploitation
- none
- Automatable
- no
- Technical impact
- partial
- Assessed
- 23 mo ago
Exploit prediction
0.52% chance of exploitation in the next 30 days, higher than 44% of all scored CVEs (FIRST EPSS, 2026-11-08).
Exploits and checks
- pyup.io https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages-part-2/ referenced PoC, tagged "exploit" by a source, unverified
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| NVD | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
| GitHub | 3.1 | 5.5 | CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | pygments | <2.15.0 <2.15.1 |
2.15.0 2.15.1 |
Classification
- Weakness
-
- CWE-434 Unrestricted Upload of File with Dangerous Type
References
-
pyup.io
/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages-part-2/
exploit, patch, third-party-advisory, web
-
github.com
/pygments/pygments/commit/97eb3d5ec7c1b3ea4fcf9dee30a2309cf92bd194
web
-
github.com
/pygments/pygments/commit/dd52102c38ebe78cd57748e09f38929fd283ad04
web
-
github.com
/pygments/pygments/commit/fdf182a7af85b1deeeb637ca970d31935e7c9d52
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/VUZO4BQCIY2S2KZYHERQMKURB7AHXDBO/
vendor-advisory
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/EZGMXALE3HSP4OXC7UUWIKX3OXKZDTY3/
vendor-advisory
-
pypi.org
/project/Pygments/
product, package
-
github.com
/pygments/pygments/blob/master/pygments/lexers/smithy.py#L61
web, third-party-advisory
- lists.fedoraproject.org /archives/list/package-announce@lists.fedoraproject.org/message/EZGMXALE3HSP4OXC7UUWIKX3OXKZDTY3/
- lists.fedoraproject.org /archives/list/package-announce@lists.fedoraproject.org/message/VUZO4BQCIY2S2KZYHERQMKURB7AHXDBO/
-
nvd.nist.gov
/vuln/detail/CVE-2022-40896
advisory
-
github.com
/pygments/pygments
package
-
github.com
/pypa/advisory-database/tree/main/vulns/pygments/PYSEC-2023-117.yaml
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/EZGMXALE3HSP4OXC7UUWIKX3OXKZDTY3
web
-
lists.fedoraproject.org
/archives/list/package-announce%40lists.fedoraproject.org/message/VUZO4BQCIY2S2KZYHERQMKURB7AHXDBO
web
-
pypi.org
/project/Pygments
web
-
pyup.io
/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages-part-2
web
-
github.com
/advisories/GHSA-mrwq-x4v8-fh7p
advisory
Sources
- CVE List CVE-2022-40896
- GitHub Advisory GHSA-mrwq-x4v8-fh7p
- NVD CVE-2022-40896
- OSV PYSEC-2023-117
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.