External risk intelligence

pybars3 Code Injection via Bracketed Path Segments.

CVE advisorySeverity: CRITICAL (CVSS 9.2)

CVE-2026-119716

pybars3 is a library component used for template rendering in Python applications. While it can be used in internet-facing web applications to process user-supplied templates, the library itself is an internal application dependency. Public exposure depends entirely on whether a specific application exposes template compilation functionality to untrusted users, which is not the typical default deployment pattern.

Code Injection

Halo Surface Signal: 3 out of 5 — possibly public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A code injection vulnerability in the pybars3 library could allow attackers to execute arbitrary Python code within an application by crafting specific template inputs. This issue arises from how the library processes unescaped bracketed path segments in template arguments, potentially enabling malicious code execution in the application's process.

  • Template input could run unauthorized code.
  • Check if this template library is in use.
  • Understand exposure and confirm relevance.

Attack Path

How an attacker could exploit the issue

An attacker could leverage this vulnerability by crafting malicious Handlebars templates. If an application allows users to supply these templates, an attacker could inject specially formed segments within helper or block arguments. This could allow them to break out of expected string limitations and execute arbitrary Python code within the application's process.

  • Requires template authoring access.
  • Maliciously crafted template segments.
  • Arbitrary Python code execution.

Live Threat

Current exploitation, exposure, and threat context

When template authors supply crafted segments in helper or block arguments, they can break out of string literals to execute Python code within the application process, affecting service behavior.

  • Application process execution.
  • Code injection via crafted template segments.
  • Potential for denial of service.

Operational Fix

Recommended remediation, mitigation, and detection steps

The pybars3 library's code injection vulnerability impacts applications that compile user-supplied templates, placing responsibility on application owners and platform teams to manage dependencies. The first step is to identify all applications utilizing pybars3, determine their exposure to untrusted input, and assess business criticality to prioritize remediation efforts.

  • Application owners should manage this issue.
  • Verify template compilation and input sources.
  • Plan remediation within maintenance windows.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is pybars3?

pybars3 is a Python implementation of the Handlebars template engine. Developers use it to build dynamic content by merging data with predefined templates, which is common in web frameworks or reporting tools that need to generate HTML or other text-based output from structured information.

What does code injection mean for CVE-2026-119716?

This vulnerability is classified as CWE-94, which refers to improper control of generation of code. In this specific case, the library fails to safely handle certain bracketed segments in templates. This allows a user who can provide template input to escape normal constraints and trick the application into running unauthorized Python commands instead of just rendering text.

How can an attacker trigger this vulnerability?

An attacker triggers this by submitting a specially crafted Handlebars template that includes malicious bracketed segments within helper or block arguments. The vulnerability does not trigger if the application only uses static, server-side templates that cannot be influenced or modified by external users.

Is my application vulnerable according to Halo Surface Signal?

Halo Surface Signal notes that while pybars3 is an internal component, its risk depends on whether your application provides an interface where untrusted users can submit or author their own templates. If your application does not allow users to influence template compilation, the attack surface is significantly limited.

What should I do if I use pybars3?

Your first step is to inventory your software to identify every location where pybars3 is integrated. Once identified, evaluate whether those specific modules accept input from external users. Prioritize remediation for systems where template compilation is exposed to untrusted sources, and monitor the library's official maintainer channels for official updates.

References