MediumGHSA-g3rq-g295-4j3mCVE-2020-28493PYSEC-2021-66SNYK-PYTHON-JINJA2-1012994

Regular Expression Denial of Service (ReDoS) in Jinja2

Published 19 Mar 2021 · Updated 14 Feb 2025

Is your project on an affected jinja2?

Private repo? Upload its lockfile instead, or connect GitHub to check every repo.

Look after several Python apps? Indie watches up to 15 repos, private ones too, for $5 a month. See Indie

Affected package

jinja2PyPI
Affected
<2.11.3
Fixed in
2.11.3
Update to the fixed version for your release line, for example:pip install 'jinja2>=2.11.3'

Details

This affects the package jinja2 from 0.0.0 and before 2.11.3. The ReDOS vulnerability of the regex is mainly due to the sub-pattern [a-zA-Z0-9._-]+.[a-zA-Z0-9._-]+ 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.

Is GHSA-g3rq-g295-4j3m in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected jinja2, and gives you the command that fixes it.

More advisories for jinja2

  • MediumCVE-2025-27516Jinja2 vulnerable to sandbox breakout through attr filter selecting format method · 5 Mar 2025
  • MediumCVE-2024-56326Jinja has a sandbox breakout through indirect reference to format method · 23 Dec 2024
  • MediumCVE-2024-56201Jinja has a sandbox breakout through malicious filenames · 23 Dec 2024
  • MediumCVE-2024-34064Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter · 6 May 2024
  • MediumCVE-2024-22195Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter · 11 Jan 2024
  • MediumCVE-2014-0012Insecure Temporary File in Jinja2 · 17 May 2022
All 10 advisories for jinja2

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.