# CVE-2022-40023: mako is vulnerable to Regular Expression Denial of Service

- Severity: High 7.5 (CVSS:3.1, scored by NVD) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 2.46%, higher than 84% of CVEs (2026-12-01)
- Public exploit code or proof of concept: 2 links below, marked "exploit"
- Published: 2022-09-07T00:00:00.000Z
- Modified: 2026-06-17T05:00:47.023Z
- Also known as: GHSA-v973-fxgf-6xhp, PYSEC-2022-260
- Weaknesses: CWE-1333
- Assigned by: mitre

## Description

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.

(As written by CVE List.)

## Affected

- Unspecified product: n/a
- mako (PyPI): before 1.2.2; before 925760291d6efec64fda6e9dd1fd9cfbd5be068c
- sqlalchemy mako: before 1.2.2
- debian debian_linux: 10.0

## Every score

- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:4.0 High `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`

## References

- <https://github.com/sqlalchemy/mako/blob/c2f392e0be52dc67d1b9770ab8cce6a9c736d547/mako/ext/extract.py#L21> (exploit, third-party-advisory, web)
- <https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages/> (exploit, third-party-advisory)
- <https://github.com/sqlalchemy/mako/issues/366> (issue-tracking, patch, report, web)
- <https://github.com/sqlalchemy/mako/commit/925760291d6efec64fda6e9dd1fd9cfbd5be068c> (fix, patch, web)
- <https://pyup.io/vulnerabilities/CVE-2022-40023/50870/> (third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2022/09/msg00026.html> (mailing-list, third-party-advisory, web)
- <https://lists.debian.org/debian-lts-announce/2025/12/msg00004.html> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2022-40023> (advisory)
- <https://github.com/advisories/GHSA-v973-fxgf-6xhp> (advisory)
- <https://github.com/pypa/advisory-database/tree/main/vulns/mako/PYSEC-2022-260.yaml> (web)
- <https://github.com/sqlalchemy/mako> (web)
- <https://pyup.io/posts/pyup-discovers-redos-vulnerabilities-in-top-python-packages> (web)
- <https://pyup.io/vulnerabilities/CVE-2022-40023/50870> (web)

## Sources

- CVE List: [CVE-2022-40023](https://www.cve.org/CVERecord?id=CVE-2022-40023), CVE Terms of Use, modified 2025-12-03
- GitHub Advisory Database: [GHSA-v973-fxgf-6xhp](https://github.com/advisories/GHSA-v973-fxgf-6xhp), CC-BY-4.0, modified 2025-12-03
- NVD: [CVE-2022-40023](https://nvd.nist.gov/vuln/detail/CVE-2022-40023), Public domain, modified 2026-06-17
- PyPA Advisory Database: [PYSEC-2022-260](https://osv.dev/vulnerability/PYSEC-2022-260), CC-BY-4.0, modified 2023-11-08

---

Page: https://cve.day/CVE-2022-40023 · Whole record: https://cve.day/CVE-2022-40023.json · Rebuilt by cve.day 2026-11-25T22:58:14.746Z
