Sandbox Escape Affecting jinja2 package, versions [,2.10.1)


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.2% (58th 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 IDSNYK-PYTHON-JINJA2-174126
  • published7 Apr 2019
  • disclosed7 Apr 2019
  • creditBrian Welch, Armin Ronacher

Introduced: 7 Apr 2019

CVE-2019-10906  (opens in a new tab)
CWE-265  (opens in a new tab)

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