Sandbox Escape Affecting jinja2 package, versions [,2.10.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    EPSS
    0.29% (70th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-JINJA2-174126
  • published 7 Apr 2019
  • disclosed 7 Apr 2019
  • credit Brian Welch, Armin Ronacher

How to fix?

Upgrade Jinja2 to version 2.10.1 or higher.

Overview

Jinja2 is a template engine written in pure Python. It provides a Django inspired non-XML syntax but supports inline expressions and an optional sandboxed environment.

Affected versions of this package are vulnerable to Sandbox Escape via the str.format_map. This vulnerability requires the attacker to have information about sensitive attributes, and exploiting it could allow the attacker to access sensitive content.

Workaround

Override the is_safe_attribute method on the sandbox and explicitly disallow the format_map method on string objects.

References

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.8 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    High
  • Privileges Required (PR)
    None
  • User Interaction (UI)
    None
  • Scope (S)
    Changed
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None
Expand this section

NVD

8.6 high
Expand this section

SUSE

8.1 high