pybars4: Code injection via bracketed path segments in templates
Summary
pybars4 through version 0.9.13 contains a code injection flaw in its template compiler. Crafted bracketed path segments in Handlebars templates, placed in helper or block arguments, can break out of the generated code and execute Python code in the application process. Exploitation requires that an attacker can supply or influence template content. The CNA rates the issue CVSS 4.0 9.2 (Critical), and NVD analysis is pending.
Affected
- up9inc pybars4 0.9.13 and earlier (<= 0.9.13)
- The sibling project pybars3 through 0.9.7 is covered by CVE-2026-119716 and should be checked separately.
Fixed in
Unknown. No fixed version has been published as of the research date. 0.9.13 is the last affected release.
Workaround
- No vendor workaround is known.
- Do not let users or external parties supply or edit template source.
- Remove pybars4 if it is not needed.
Exploitation
- CISA KEV: not listed.
- CISA SSVC: exploitation none, automatable no, technical impact total.
- No public proof of concept was found; this does not rule one out.
- Overall: no known exploitation.
Our recommendation
- Search software inventories, requirements files and SBOMs for pybars4 and pybars3, including transitive dependencies.
- Determine whether any template content can come from untrusted sources. If so, restrict or remove that input path now.
- If no untrusted input exists, document the accepted risk and monitor the upstream repository and NVD for a fix.
- Check whether applications that embed the library are internet-facing.
Research sources
- up9inc pybars4 repository github.com
- pybars4 _compiler.py at tag 0.9.13 github.com
- VulnCheck advisory for pybars4 www.vulncheck.com
- vladko312 advisory for pybars3 github.com
- Strix CVE summary CVE-2026-119717 www.strix.ai
- pybars4 changelog github.com
- pybars4 on PyPI pypi.org
- CodeQL: Template injection (Python) codeql.github.com
Researched and written up in English and German by an AI (Claude by Anthropic) based on NVD, CISA, EPSS and the sources listed. The vendor information is authoritative. Researched on 31 Oct 2026, 03:52.
Original description (NVD)
pybars4 through 0.9.13 contains a code injection vulnerability in pybars/_compiler.py that allows attackers to execute Python code via unescaped bracketed path segments in Handlebars templates. Attackers can supply a template with a crafted segment in a helper or block argument to break out of the generated resolve() string literal and execute code in the application process.
NVD references (4)
- https://github.com/up9inc/pybars4
- https://github.com/up9inc/pybars4/blob/0.9.13/pybars/_compiler.py#L153-L154
- https://github.com/vladko312/advisories/blob/702e98db9642ece70d9e2150076d8014ffec2db3/pybars3.md
- https://www.vulncheck.com/advisories/pybars4-through-0.9.13-code-injection-via-bracketed-path-segments
Affected? We can help.
We check whether your systems are affected, install updates and close the gap – continuously with the System Health Checker if you wish.
Data: NVD (NIST), CISA KEV, FIRST EPSS – updated continuously.
