flask-sqlalchemy-tutorial
flask-sqlalchemy-tutorial copied to clipboard
chore(deps): update dependency jinja2 to v3.1.6 [security]
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| jinja2 (changelog) | ==3.1.4 -> ==3.1.6 |
GitHub Vulnerability Alerts
CVE-2024-56326
An oversight in how the Jinja sandboxed environment detects calls to str.format allows an attacker that controls the content of a template to execute arbitrary Python code.
To exploit the vulnerability, an attacker needs to control the content of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates.
Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to store a reference to a malicious string's format method, then pass that to a filter that calls it. No such filters are built-in to Jinja, but could be present through custom filters in an application. After the fix, such indirect calls are also handled by the sandbox.
CVE-2024-56201
A bug in the Jinja compiler allows an attacker that controls both the content and filename of a template to execute arbitrary Python code, regardless of if Jinja's sandbox is used.
To exploit the vulnerability, an attacker needs to control both the filename and the contents of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates where the template author can also choose the template filename.
CVE-2025-27516
An oversight in how the Jinja sandboxed environment interacts with the |attr filter allows an attacker that controls the content of a template to execute arbitrary Python code.
To exploit the vulnerability, an attacker needs to control the content of a template. Whether that is the case depends on the type of application using Jinja. This vulnerability impacts users of applications which execute untrusted templates.
Jinja's sandbox does catch calls to str.format and ensures they don't escape the sandbox. However, it's possible to use the |attr filter to get a reference to a string's plain format method, bypassing the sandbox. After the fix, the |attr filter no longer bypasses the environment's attribute lookup.
Release Notes
pallets/jinja (jinja2)
v3.1.6
This is the Jinja 3.1.6 security release, which fixes security issues but does not otherwise change behavior and should not result in breaking changes compared to the latest feature release.
PyPI: https://pypi.org/project/Jinja2/3.1.6/ Changes: https://jinja.palletsprojects.com/en/stable/changes/#version-3-1-6
- The
|attrfilter does not bypass the environment's attribute lookup, allowing the sandbox to apply its checks. https://github.com/pallets/jinja/security/advisories/GHSA-cpwx-vrp4-4pq7
v3.1.5
Released 2024-12-21
- The sandboxed environment handles indirect calls to
str.format, such as by passing a stored reference to a filter that calls its argument. :ghsa:q2x7-8rv6-6q7h - Escape template name before formatting it into error messages, to avoid
issues with names that contain f-string syntax.
:issue:
1792, :ghsa:gmj6-6f8f-6699 - Sandbox does not allow
clearandpopon known mutable sequence types. :issue:2032 - Calling sync
renderfor an async template usesasyncio.run. :pr:1952 - Avoid unclosed
auto_aiterwarnings. :pr:1960 - Return an
aclose-ableAsyncGeneratorfromTemplate.generate_async. :pr:1960 - Avoid leaving
root_render_func()unclosed inTemplate.generate_async. :pr:1960 - Avoid leaving async generators unclosed in blocks, includes and extends.
:pr:
1960 - The runtime uses the correct
concatfunction for the current environment when calling block references. :issue:1701 - Make
|uniqueasync-aware, allowing it to be used after another async-aware filter. :issue:1781 |intfilter handlesOverflowErrorfrom scientific notation. :issue:1921- Make compiling deterministic for tuple unpacking in a
{% set ... %}call. :issue:2021 - Fix dunder protocol (
copy/pickle/etc) interaction withUndefinedobjects. :issue:2025 - Fix
copy/picklesupport for the internalmissingobject. :issue:2027 Environment.overlay(enable_async)is applied correctly. :pr:2061- The error message from
FileSystemLoaderincludes the paths that were searched. :issue:1661 PackageLoadershows a clearer error message when the package does not contain the templates directory. :issue:1705- Improve annotations for methods returning copies. :pr:
1880 urlizedoes not addmailto:to values like@a@b. :pr:1870- Tests decorated with
@pass_context`` can be used with the ``|select`` filter. :issue:1624` - Using
setfor multiple assignment (a, b = 1, 2) does not fail when the target is a namespace attribute. :issue:1413 - Using
setin all branches of{% if %}{% elif %}{% else %}blocks does not cause the variable to be considered initially undefined. :issue:1253
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.