Skip to content
Fencer Intel
medium 5.5

CVE-2022-40896 json

Pygments vulnerable to ReDoS

published 3y ago modified 4mo 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

Is CVE-2022-40896 in your dependencies? Fencer shows which of your repositories are affected as soon as an advisory lands, and opens the fix as a pull request.

Check with Fencer

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-container
    affected: 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 more
    affected: 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 more
    affected: workaround, no fix available, no fix planned “Will not fix”
  • Red Hat Enterprise Linux 9 python3.11-pip, python3.11-pip-wheel
    affected: 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-573
    fixed: 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.el8pc
    fixed: 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 more
    not 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
last yr.

Exploit prediction

0.52% chance of exploitation in the next 30 days, higher than 44% of all scored CVEs (FIRST EPSS, 2026-11-09).

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

Sources

Fencer Intel 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.