Jinja2 versions prior to 3.1.6 contain a sandbox breakout vulnerability via the attr filter, allowing attackers controlling template content to execute arbitrary Python code. The flaw arises because the attr filter can bypass sandbox restrictions on the string format method. This vulnerability affects applications that execute untrusted templates. A fix is available in version 3.1.6 that prevents the attr filter from bypassing sandbox attribute lookups.