Skip to content
Fencer Vulns
high 7.5

CVE-2022-40023 json

mako is vulnerable to Regular Expression Denial of Service

published 2022-09-07 4 y ago modified 2026-06-17 4 mo ago also GHSA-v973-fxgf-6xhp , PYSEC-2022-260 , EUVD-2022-0149

cvss
7.5
version 3.1, NVD
cisa kev
Not listed
not in CISA's catalog
epss
2.3%
EPSS 2.3% chance of exploitation in 30 days, percentile 83%
public exploits
0
none known

Summary

Sqlalchemy mako before 1.2.2 is vulnerable to Regular expression Denial of Service when using the Lexer class to parse. This also affects babelplugin and linguaplugin.

Patch / fix

  • pypi mako 1.2.2
  • sqlalchemy mako 1.2.2
  • mako Debian 14, Debian 13, Debian 12 1.2.2+ds1-1

debian advisories DEBIAN-CVE-2022-40023

  • mako Ubuntu 18.04 LTS 1.0.7+ds1-1ubuntu0.2
  • mako Ubuntu 20.04 LTS 1.1.0+ds1-1ubuntu2.1
  • mako Ubuntu 22.04 LTS 1.1.3+ds1-2ubuntu0.1
  • mako Ubuntu Pro 16.04 LTS 1.0.3+ds1-1ubuntu1+esm1

ubuntu advisories UBUNTU-CVE-2022-40023

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

  • python-mako RHEL 8 1.0.6-14.el8
  • python3-mako RHEL 8 1.0.6-14.el8
  • python-mako RHEL 9 1.1.4-6.el9
  • python3-mako RHEL 9 1.1.4-6.el9

red hat advisories RHSA-2023:2893RHSA-2023:2258

  • python-Mako SLE Module for Package Hub 15 SP4, SLE Module for Package Hub 15 SP3, SLE Module for Basesystem 15 SP4 +3 more 1.0.7-150000.3.3.1
  • python-Mako OpenStack Cloud Crowbar 8, OpenStack Cloud 8, HPE Helion OpenStack 8 1.0.7-3.3.1
  • python-Mako OpenStack Cloud Crowbar 9, OpenStack Cloud 9 1.0.7-4.3.1

suse advisories SUSE-SU-2022:3979-1SUSE-SU-2022:3701-1SUSE-SU-2022:3700-1

  • python-Mako openSUSE Tumbleweed 1.4.1-1.1
  • python-Mako openSUSE Tumbleweed 1.3.0-2.1

opensuse advisories openSUSE-SU-2026:11567-1openSUSE-SU-2024:13610-1

  • python3-mako AlmaLinux 8 1.0.6-14.el8
  • python3-mako AlmaLinux 9 1.1.4-6.el9

almalinux advisories ALSA-2023:2893ALSA-2023:2258

  • python-mako Rocky Linux 9 1.1.4-6.el9
  • python-mako Rocky Linux 8 1.0.6-14.el8

rocky linux advisories RLSA-2023:2258RLSA-2023:2893

  • py3-mako Alpine 3.24, Alpine 3.23, Alpine 3.22 +6 more 1.2.2-r0

alpine advisories ALPINE-CVE-2022-40023

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • python-mako CBL-Mariner 2.0 1.2.2-1

azure linux advisories AZL-10892

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-40023 updated cvss 7.5

python-mako: REDoS in Lexer class

  • Red Hat Ceph Storage 3 python-pecan Red Hat Enterprise Linux 6 python-mako Red Hat Enterprise Linux 7 python-mako, resource-agents, resource-agents-gcp, resource-agents-sap, sap-cluster-connector, resource-agents-aliyun, +2 more
    affected: no fix planned “Out of support scope”
  • Red Hat Enterprise Linux 8 resource-agents, resource-agents-gcp, resource-agents-paf, resource-agents-aliyun
    affected: no fix planned “Will not fix”
  • Red Hat Openshift Container Storage 4 python-pecan Red Hat Openshift Data Foundation 4 python-pecan
    affected: no fix available
  • Red Hat OpenStack Platform 13 (Queens) python-pecan, python2-pecan
    affected: no fix planned “Out of support scope”
  • Red Hat Quay 3 quay/quay-rhel8
    affected: no fix available
  • Red Hat Enterprise Linux AppStream (v. 8) python-mako 1.0.6-14.el8, python3-mako 1.0.6-14.el8
    fixed: vendor fix RHSA-2023:2893
  • Red Hat Enterprise Linux AppStream (v. 9) python-mako 1.1.4-6.el9, python3-mako 1.1.4-6.el9
    fixed: vendor fix RHSA-2023:2258
  • Red Hat Ceph Storage 4 python2-pecan, python3-pecan Red Hat Ceph Storage 5 python-pecan Red Hat OpenStack Platform 16.1 python3-pecan Red Hat OpenStack Platform 16.2 python3-pecan Red Hat OpenStack Platform 17.0 python3-pecan
    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

Exploit prediction

2.32% chance of exploitation in the next 30 days, higher than 83% of all scored CVEs (FIRST EPSS, 2026-11-08).

Exploits and checks

  • github.com https://github.com/sqlalchemy/mako/blob/c2f392e0be52dc67d1b9770ab8cce6a9c736d547/mako/ext/extract.py#L21 referenced PoC, tagged "exploit" by a source, unverified
  • pyup.io https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/ referenced PoC, tagged "exploit" by a source, unverified

CVSS scores

assigned by version score vector
NVD 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub 3.1 7.5 CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected packages

ecosystem package affected fixed in
pypi mako
<1.2.2
1.2.2

Classification

Weakness
  • CWE-1333 Inefficient Regular Expression Complexity

References

Sources

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.