---
id: "CVE-2026-119717"
kind: "vulnerability"
aliases: ["CVE-2026-119717"]
title: "pybars4: crafted Handlebars templates run Python code in the app"
severity: "critical"
cvss: 9.2
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["handlebars", "package", "pybars4", "python"]
not_affected_if: ["fixed-templates-only"]
published_at: "2026-10-30T16:17:55+00:00"
first_seen_at: "2026-10-30T16:31:26+00:00"
updated_at: "2026-10-30T16:31:45+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-119717", "first_seen_at": "2026-10-30T16:31:26+00:00"}]
---

# pybars4: crafted Handlebars templates run Python code in the app

pybars4 is a Python library that renders Handlebars templates; through version 0.9.13, unescaped bracketed path segments let a template break out of generated code and execute Python in the host process. An attacker who can supply or influence a template can run arbitrary code as the application.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `pip show pybars4` and look for versions up to `0.9.13`.
- Search dependency files (`requirements.txt`, `poetry.lock`, `Pipfile.lock`) for `pybars4`.
- Find code that compiles templates from user-supplied input when using pybars4.

## Fix

- pybars4 versions through `0.9.13` are affected; the sources do not name a fixed version.

## Timeline

- 2026-10-30T16:31:26+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-119717

## From the sources

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.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
