/

CVE-2026-33587

Severity:

CRITICAL RISK

(10.0)

Server-Side Template Injection in Open Notebook User

CVE-2026-33587

Analyzed

Vulnerability type

Category:

Server-Side Template Injection

CWE:

CWE-20

Impact:

Remote Code Execution within Application Container

Severity:

CRITICAL RISK

(10.0)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Open Notebook v1.8.3 suffers from insufficient user input sanitization in user-created transformations, enabling server-side template injection (SSTI).

An authenticated application user can craft malicious template input that is evaluated on the server, leading to arbitrary Python code execution and potentially full OS command execution inside the Docker container.

Affected context

The vulnerability exists in Open Notebook deployments that allow users to define or configure custom transformations rendered through a server-side templating engine.

When user-controlled transformation expressions are processed without strict validation or escaping, the template engine interprets them as executable code.

This typically affects environments where Open Notebook runs inside a Docker container and exposes transformation features to authenticated users or automation.

Exploit preconditions

  • Attack surface: Application web interface or API for creating/updating user transformations
  • Required access: Valid user access capable of defining or modifying transformations (no need for shell access)
  • Trigger point: Rendering or evaluating user-defined transformation templates on the server side
  • Why exploitation is possible: User input is directly embedded into a server-side template context without adequate sanitization, validation, or use of a safe expression language, allowing execution of template expressions that can escape into arbitrary Python code and OS commands

Why this happens

The core issue is improper input validation (CWE-20) combined with the powerful capabilities of the server-side templating engine.

User-controlled transformation strings are treated as trusted template code and passed into the rendering engine without enforcing a strict, limited syntax or escaping untrusted constructs.

In this pattern, the template engine offers access to objects, attributes, or helper functions that can be chained to execute arbitrary Python code, ultimately enabling execution of OS commands inside the container.

The vulnerability reflects a broader class of SSTI problems where presentation-layer templating is mixed with business logic and direct user input.

Potential impact

  • Execution of arbitrary Python code within the Open Notebook process
  • Execution of OS commands inside the Docker container hosting the application
  • Reading or modification of data accessible to the application (notebooks, datasets, configuration)
  • Potential pivot to other internal services reachable from the container
  • Abuse of the container's network access for further attacks or data exfiltration

General mitigation guidance

Effective mitigation focuses on decoupling user input from executable template logic and constraining what the template engine can do:

  • Restrict user-defined transformations to a safe, declarative expression language or pre-defined operations rather than raw template code.
  • Apply strict input validation and allowlisting for transformation syntax, rejecting any constructs outside a narrow, documented grammar.
  • Disable or sandbox dangerous template engine features, such as access to internals, object attributes, or arbitrary function calls.
  • Ensure untrusted data is always treated as data, not code, by using automatic escaping and avoiding direct concatenation into templates.
  • Run the application with least-privilege OS and container permissions to reduce the blast radius of a potential compromise.

How teams detect issues like this

Organizations can approach detection by combining code-centric and behavior-centric techniques:

  • Use static analysis or linters to flag direct injection of user input into template render calls or dynamic evaluation APIs.
  • During code review, scrutinize any feature that lets users define "templates," "expressions," or "transformations," verifying that input is constrained and not evaluated as arbitrary code.
  • Implement application-layer monitoring to detect unusual template errors or stack traces that reference internal objects or evaluation failures.
  • Analyze container and application logs for suspicious transformation content, unexpected subprocess execution, or sudden spikes in error responses when transformations are rendered.

Sources

SourceLink
github.comgithub.com/lfnovo/open-notebook/security/advisories/GHSA-f35w-wx37-26q7

Frequently asked

questions

Yes. Any user who can reach the Open Notebook interface or API and create or modify transformations can potentially exploit the SSTI flaw, subject to authentication and authorization controls.

Not necessarily. Exploitation generally requires only the level of access needed to define or edit user transformations; a regular authenticated user account may be sufficient if no further restrictions are in place.

Replace direct evaluation of user-provided template strings with a strictly limited transformation mechanism, such as a safe expression language or a set of predefined operations, and ensure user input is never treated as executable template code.

When designing features that interpret user input, treat all such input as untrusted data, enforce allowlisted grammars, avoid dynamic evaluation APIs, and include template and expression handling in security reviews and automated checks.

Find out what's already
exploitable in your codebase.