CVE-2022-40023 json
mako is vulnerable to Regular Expression Denial of Service
published 4y ago modified 4mo 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
Is CVE-2022-40023 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 FencerVendor 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 moreaffected: no fix planned “Out of support scope”
-
Red Hat Enterprise Linux 8 resource-agents, resource-agents-gcp, resource-agents-paf, resource-agents-aliyunaffected: no fix planned “Will not fix”
-
Red Hat Openshift Container Storage 4 python-pecan Red Hat Openshift Data Foundation 4 python-pecanaffected: no fix available
-
Red Hat OpenStack Platform 13 (Queens) python-pecan, python2-pecanaffected: no fix planned “Out of support scope”
-
Red Hat Quay 3 quay/quay-rhel8affected: no fix available
-
Red Hat Enterprise Linux AppStream (v. 8) python-mako 1.0.6-14.el8, python3-mako 1.0.6-14.el8fixed: 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.el9fixed: 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-pecannot 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-09).
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
-
github.com
/sqlalchemy/mako/commit/925760291d6efec64fda6e9dd1fd9cfbd5be068c
web, patch
-
github.com
/sqlalchemy/mako/issues/366
web, issue-tracking, patch, report
-
github.com
/sqlalchemy/mako/blob/c2f392e0be52dc67d1b9770ab8cce6a9c736d547/mako/ext/extract.py#L21
web, exploit, third-party-advisory
-
pyup.io
/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
exploit, third-party-advisory
-
pyup.io
/vulnerabilities/CVE-2022-40023/50870/
third-party-advisory, web
-
lists.debian.org
/debian-lts-announce/2022/09/msg00026.html
mailing-list, web, third-party-advisory
-
lists.debian.org
/debian-lts-announce/2025/12/msg00004.html
web
-
nvd.nist.gov
/vuln/detail/CVE-2022-40023
advisory
-
github.com
/advisories/GHSA-v973-fxgf-6xhp
advisory
-
github.com
/pypa/advisory-database/tree/main/vulns/mako/PYSEC-2022-260.yaml
web
-
github.com
/sqlalchemy/mako
web
-
pyup.io
/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages
web
-
pyup.io
/vulnerabilities/CVE-2022-40023/50870
web
Sources
- CVE List CVE-2022-40023
- GitHub Advisory GHSA-v973-fxgf-6xhp
- NVD CVE-2022-40023
- OSV PYSEC-2022-260
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.