Technical impact
A flaw in the compiler routine of pybars3 and pybars4 allows any template author to insert unescaped bracketed path segments that are interpreted as Python code. When a template containing such a segment is compiled, the application executes the injected code inside the same process. This can lead to arbitrary code execution within the context of the running application, potentially granting the attacker full control if the process runs with elevated privileges.
Affected Systems
The vulnerability affects pybars3 versions up to 0.9.7 from the wbond project and pybars4 versions up to 0.9.13 from the up9inc project. Any installation of these libraries that compiles Handlebars templates is at risk.
Risk and Exploitability
The CVSS score of 9.3 indicates a critical severity. The EPSS score is less than 1%, suggesting a low but nonzero chance of exploitation. While the flaw is not listed in the CISA KEV catalog, it can be triggered by supplying a crafted template to any vulnerable application. Exploitation requires the ability to provide template content, making the attack vector local or remote template injection, and results in execution of arbitrary Python code within the application process.