Is jinja2 3.1 vulnerable?

PyPI · 7 releases from 3.1.0 to 3.1.6 · latest jinja2 is 3.1.6 · checked 18 Nov 2026

No known advisories in the last release

jinja2 3.1.6, the last 3.1 release, has no known advisories. 5 advisories affect earlier 3.1.x releases, so update to 3.1.6.

Update within 3.1:pip install 'jinja2>=3.1.6'

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

Fixed within 3.1.x, affecting earlier releases

  • MediumCVE-2025-27516GHSA-cpwx-vrp4-4pq75 Mar 2025

    Jinja2 vulnerable to sandbox breakout through attr filter selecting format method

    Affected
    <3.1.6
    Fixed in
    3.1.6
  • MediumCVE-2024-56326GHSA-q2x7-8rv6-6q7h23 Dec 2024

    Jinja has a sandbox breakout through indirect reference to format method

    Affected
    <3.1.5
    Fixed in
    3.1.5
  • MediumCVE-2024-56201GHSA-gmj6-6f8f-669923 Dec 2024

    Jinja has a sandbox breakout through malicious filenames

    Affected
    >=3.0.0 <3.1.5
    Fixed in
    3.1.5
  • MediumCVE-2024-34064GHSA-h75v-3vvj-5mfj6 May 2024

    Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

    Affected
    <3.1.4
    Fixed in
    3.1.4
  • MediumCVE-2024-22195GHSA-h5c8-rqwp-cp9511 Jan 2024

    Jinja vulnerable to HTML attribute injection when passing user input as keys to xmlattr filter

    Affected
    <3.1.3
    Fixed in
    3.1.3

Every jinja2 3.1.x release

Affected: 3.1.0 to 3.1.5. 3.1.6 is not affected.

VersionKnown advisories
jinja2 3.1.6None
jinja2 3.1.5CVE-2025-27516
jinja2 3.1.4CVE-2025-27516, CVE-2024-56326, CVE-2024-56201
jinja2 3.1.3CVE-2025-27516, CVE-2024-56326, CVE-2024-56201, CVE-2024-34064
jinja2 3.1.2CVE-2025-27516, CVE-2024-56326, CVE-2024-56201, CVE-2024-34064, CVE-2024-22195
jinja2 3.1.1CVE-2025-27516, CVE-2024-56326, CVE-2024-56201, CVE-2024-34064, CVE-2024-22195
jinja2 3.1.0CVE-2025-27516, CVE-2024-56326, CVE-2024-56201, CVE-2024-34064, CVE-2024-22195

Which of your client projects are still on jinja2 3.1?

NPMscan reads the lockfiles in every GitHub repo you pick, finds the exact jinja2 version each one installs, and checks it against these advisories. Each finding comes with the command that fixes it.

Other jinja2 versions

Advisory data from OSV.dev (opens OSV.dev in a new tab), which includes the GitHub Advisory Database. Release list from the PyPI registry. Refreshed daily.