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.
CVE-2022-40023
This high-severity CVE scores 7.5 under NVD CVSS v3. EPSS exploit probability: 1.0%, top 23% of all CVEs by exploit prediction. GitHub Security Advisory data not yet ingested — confidence will rise once GHSA publishes (typical lag: hours to days for open-source ecosystem CVEs; never for infrastructure-only CVEs).
- High severity, but no confirmed exploitation yet
A fix is available — apply it.
- CVSS v3
- 7.5
- EG Score
- 7.5(medium)
- EPSS
- 74.8%
- KEV
- Not listed
Published
September 7, 2022
Last Modified
December 3, 2025
References (13)
- cve@mitrehttps://github.com/sqlalchemy/mako/blob/c2f392e0be52dc67d1b9770ab8cce6a9c736d547/mako/ext/extract.py#L21
- cve@mitrehttps://github.com/sqlalchemy/mako/commit/925760291d6efec64fda6e9dd1fd9cfbd5be068c
- cve@mitrehttps://github.com/sqlalchemy/mako/issues/366
- cve@mitrehttps://lists.debian.org/debian-lts-announce/2022/09/msg00026.html
- cve@mitrehttps://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
- cve@mitrehttps://pyup.io/vulnerabilities/CVE-2022-40023/50870/
- af854a3a-2127-422b-91ae-364da2661108https://github.com/sqlalchemy/mako/blob/c2f392e0be52dc67d1b9770ab8cce6a9c736d547/mako/ext/extract.py#L21
- af854a3a-2127-422b-91ae-364da2661108https://github.com/sqlalchemy/mako/commit/925760291d6efec64fda6e9dd1fd9cfbd5be068c
- af854a3a-2127-422b-91ae-364da2661108https://github.com/sqlalchemy/mako/issues/366
- af854a3a-2127-422b-91ae-364da2661108https://lists.debian.org/debian-lts-announce/2022/09/msg00026.html
- af854a3a-2127-422b-91ae-364da2661108https://lists.debian.org/debian-lts-announce/2025/12/msg00004.html
- af854a3a-2127-422b-91ae-364da2661108https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/
- af854a3a-2127-422b-91ae-364da2661108https://pyup.io/vulnerabilities/CVE-2022-40023/50870/
Patch Availability(4)
| Vendor / Ecosystem | Fixed in / Patch | Released | Source |
|---|---|---|---|
| ubuntu | python3-mako (1.0.7+ds1-1ubuntu0.2) @ bionic | 2026-05-25 | ubuntu |
| ubuntu | python3-mako (1.1.3+ds1-3ubuntu2.1) @ kinetic | 2026-05-25 | ubuntu |
| redhat | python-mako-0:1.0.6-14.el8 | 2023-05-16 | redhat |
| redhat | python-mako-0:1.1.4-6.el9 | 2023-05-09 | redhat |
Patches are aggregated from vendor advisories (Red Hat, Microsoft, Cisco, GitHub) and package ecosystems (OSV, GHSA). Multiple rows for the same upstream release have been deduplicated.
Affected Packages
(1 across 1 ecosystem)
PyPI(1)
| Package | Vulnerable range | Fixed in | Dependents |
|---|---|---|---|
| mako | 0.1.0 ... 1.2.1 (63 versions) | 1.2.2 | — |
Weakness Classification(1)
MITRE Common Weakness Enumeration — the root-cause categories this CVE belongs to.
All Vendor Advisories
(5)
Every vendor that published an advisory referencing this CVE — pulled from our cve_vendor_advisories aggregation. Click any row for the vendor's original advisory page.
- Microsoft MSRCCVE-2022-400232022-09-10
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.
- Red HatRHSA-2023:2258MODERATE2022-09-07
RHSA-2023:2258 — Moderate
- Red HatRHSA-2023:2893MODERATE2022-09-07
RHSA-2023:2893 — Moderate
- UbuntuUSN-5625-1MEDIUM
Mako vulnerability
- UbuntuUSN-5625-2MEDIUM
Mako vulnerability
Data Freshness Timeline
(refreshed 8× in last 7d / 42× in last 30d)
Each row is a source pipeline that fetched or updated this CVE on that date, with what changed. For example, "NVD update" means NVD published or revised its analysis for this CVE; "MITRE cvelistV5" means we ingested or refreshed it from the CNA feed. Most recent first.
- 2026-07-12 05:44 UTCEPSS rescore
- 2026-07-11 08:25 UTCEPSS rescore
- 2026-07-11 08:25 UTCEPSS rescore
- 2026-07-09 19:08 UTCEPSS rescore
- 2026-07-08 15:12 UTCEPSS rescore
- 2026-07-07 13:44 UTCEPSS rescore
- 2026-07-06 16:25 UTCEPSS rescore
- 2026-07-06 02:21 UTCEPSS rescore
- 2026-07-05 02:28 UTCEPSS rescore
- 2026-07-04 06:29 UTCEPSS rescore
- 2026-07-02 16:58 UTCEPSS rescore
- 2026-07-01 15:04 UTCEPSS rescore
- 2026-06-30 23:20 UTCEPSS rescore
- 2026-06-30 23:20 UTCEPSS rescore
- 2026-06-28 19:02 UTCOSV refresh
- 2026-06-28 14:06 UTCEPSS rescore
- 2026-06-28 04:54 UTCEPSS rescore
- 2026-06-28 04:54 UTCEPSS rescore
- 2026-06-27 03:07 UTCEPSS rescore
- 2026-06-27 03:07 UTCEPSS rescore
- 2026-06-25 13:48 UTCEPSS rescore
- 2026-06-25 13:48 UTCEPSS rescore
- 2026-06-24 14:03 UTCEPSS rescore
- 2026-06-23 21:31 UTCEPSS rescore
- 2026-06-23 21:31 UTCEPSS rescore
Show 55 moreShow fewer
- 2026-06-22 14:24 UTCEPSS rescore
- 2026-06-21 14:55 UTCEPSS rescore
- 2026-06-21 14:55 UTCEPSS rescore
- 2026-06-21 01:58 UTCEPSS rescore
- 2026-06-21 01:58 UTCEPSS rescore
- 2026-06-19 19:24 UTCEPSS rescore
- 2026-06-19 19:24 UTCEPSS rescore
- 2026-06-18 17:51 UTCEPSS rescore
- 2026-06-18 17:51 UTCEPSS rescore
- 2026-06-17 17:51 UTCEPSS rescore
- 2026-06-17 17:51 UTCEPSS rescore
- 2026-06-16 17:51 UTCEPSS rescore
- 2026-06-15 17:46 UTCEPSS rescore
- 2026-06-14 23:16 UTCEPSS rescore
- 2026-06-13 22:59 UTCEPSS rescore
- 2026-06-12 23:10 UTCEPSS rescore
- 2026-06-12 23:10 UTCEPSS rescore
- 2026-06-11 13:58 UTCEPSS rescore
- 2026-06-11 13:58 UTCEPSS rescore
- 2026-06-11 12:39 UTCOSV refresh
- 2026-06-10 22:17 UTCEPSS rescore
- 2026-06-10 13:21 UTCEPSS rescore
- 2026-06-10 13:21 UTCEPSS rescore
- 2026-06-08 14:15 UTCEPSS rescore
- 2026-06-07 15:23 UTCEPSS rescore
- 2026-06-07 15:23 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-06 13:46 UTCEPSS rescore
- 2026-06-05 22:46 UTCEPSS rescore
- 2026-06-05 22:46 UTCEPSS rescore
- 2026-06-05 06:09 UTCEPSS rescore
- 2026-06-05 06:09 UTCEPSS rescore
- 2026-06-04 13:11 UTCEPSS rescore
- 2026-06-02 20:12 UTCEPSS rescore
- 2026-06-02 20:11 UTCEPSS rescore
- 2026-06-01 13:50 UTCEPSS rescore
- 2026-06-01 13:50 UTCEPSS rescore
- 2026-05-31 22:29 UTCEPSS rescore
- 2026-05-31 22:29 UTCEPSS rescore
- 2026-05-31 00:15 UTCEPSS rescore
- 2026-05-31 00:15 UTCEPSS rescore
- 2026-05-29 13:43 UTCEPSS rescore
- 2026-05-29 13:43 UTCEPSS rescore
- 2026-05-28 13:43 UTCEPSS rescore
- 2026-05-28 13:43 UTCEPSS rescore
- 2026-05-27 13:39 UTCEPSS rescore
- 2026-05-27 13:39 UTCEPSS rescore
- 2026-05-26 13:43 UTCEPSS rescore
- 2026-05-26 13:43 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-26 07:17 UTCEPSS rescore
- 2026-05-25 15:55 UTCEG score recompute
- 2026-05-25 15:55 UTCVendor advisory
Related CVEs(same vendor + same CWE)
Same vendor
10 shownmsrc · redhat
Frequently asked(5)
What is CVE-2022-40023?
When was CVE-2022-40023 disclosed?
Is CVE-2022-40023 actively exploited?
What is the CVSS score of CVE-2022-40023?
How do I remediate CVE-2022-40023?
Dependency Blast Radius
See which npm, PyPI, Go, and Maven packages are affected by CVE-2022-40023
Is Your Infrastructure Affected by CVE-2022-40023?
EchelonGraph automatically scans your cloud infrastructure and maps CVE exposure using blast radius analysis.