Opik SDKs render Jinja2/Nunjucks prompt templates without a sandbox, allowing code execution
8.8
High
CVSS 3.1 base
What to do
If you run before 2.2.123, upgrade to 2.2.123 or later.
If you run before 2.2.123, upgrade to 2.2.123 or later.
Anyone who can reach it over the network, with no account, if a user takes some action, can read and change sensitive data and make it unavailable.Read from the CVSS 3.1 vector
To exploit it
What it gets
This page reproduces the published advisory for this finding. The advisory of record is linked above.
| Package | Ecosystem | Vulnerable | Fixed in |
|---|---|---|---|
opik | pip | < 2.2.123 | 2.2.123 |
opik | npm | < 2.2.123 | 2.2.123 |
Before 2.2.123, the Opik Python and TypeScript SDKs rendered prompts of type jinja2 with an unsandboxed template engine (Jinja2 in Python, Nunjucks in TypeScript). A template containing crafted template expressions could execute arbitrary code in the process that formats the prompt.
An application is affected if it formats a jinja2 prompt whose template text can be written by someone the application does not fully trust. One example is a prompt fetched from a shared Opik workspace fetched from a shared Opik workspace (get_prompt() in Python, getPrompt() in TypeScript) and then rendered with format(). The code runs with the privileges of the application process, including its environment variables, credentials and network access. On self-hosted Opik deployments running without authentication, anyone who can reach the Opik API can create or edit prompts.
Prompts of the default mustache type are not affected.
Fixed in opik 2.2.123 (PyPI and npm). The Python SDK now renders Jinja2 templates in Jinja2’s SandboxedEnvironment, and the TypeScript SDK renders with a restricted Nunjucks environment. Upgrade to 2.2.123 or later.
If you cannot upgrade:
jinja2 prompts whose template text comes from sources you do not control.mustache prompts instead.Reported by sfwani.
Sanaan Fayaz Wani (GitHub sfwani) reported this vulnerability to the opik maintainers under coordinated disclosure and is credited as a reporter in GHSA-5mc6-2qfj-59cg, published 2026-11-05.
All published findings: advisory index.