/

CVE-2026-55376

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Heym Python Tools

CVE-2026-55376

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78, CWE-94, CWE-693

Impact:

Remote Code Execution

Severity:

HIGH RISK

(8.8)

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

Heym's Agent custom Python tool can bypass its blacklist-based sandbox because permitted standard-library modules expose operating-system, process, and filesystem capabilities. An authenticated user who can create or edit a workflow may cause the backend to execute commands or perform file operations with the application's privileges.

Heym's Agent custom Python tool can bypass its blacklist-based sandbox because permitted standard-library modules expose operating-system, process, and filesystem capabilities. An authenticated user who can create or edit a workflow may cause the backend to execute commands or perform file operations with the application's privileges.

Affected context

The issue affects self-hosted Heym deployments that allow authenticated users to create or modify workflows containing Agent custom Python tools. Risk arises when the backend relies on blacklist-based import and code checks, then executes user-controlled Python with the application's operating-system privileges. Self-registration may increase reachability in some deployments, but triggering a portal workflow alone does not necessarily provide code control.

The issue affects self-hosted Heym deployments that allow authenticated users to create or modify workflows containing Agent custom Python tools. Risk arises when the backend relies on blacklist-based import and code checks, then executes user-controlled Python with the application's operating-system privileges. Self-registration may increase reachability in some deployments, but triggering a portal workflow alone does not necessarily provide code control.

Exploit preconditions

  • Attack surface: Agent custom Python tool execution in the backend workflow system
  • Required access: An authenticated account with permission to create or edit a workflow containing the tool
  • Trigger point: Execution of the workflow by the backend Python runner
  • Why exploitation is possible: Allowed standard-library modules expose operating-system, process, and filesystem functionality through public attributes that evade blacklist checks before the supplied code is executed
  • Attack surface: Agent custom Python tool execution in the backend workflow system
  • Required access: An authenticated account with permission to create or edit a workflow containing the tool
  • Trigger point: Execution of the workflow by the backend Python runner
  • Why exploitation is possible: Allowed standard-library modules expose operating-system, process, and filesystem functionality through public attributes that evade blacklist checks before the supplied code is executed

Why this happens

The underlying flaw is reliance on blacklist-based sandboxing for untrusted Python code. Import and code-validation checks evaluate selected names or patterns, but do not reliably constrain the capabilities reachable through permitted modules and their public attributes. The runner then passes user-influenced code to exec(), allowing the supplied program to access process, operating-system, and filesystem operations. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related characteristics of CWE-94: Improper Control of Generation of Code and CWE-693: Protection Mechanism Failure.

The underlying flaw is reliance on blacklist-based sandboxing for untrusted Python code. Import and code-validation checks evaluate selected names or patterns, but do not reliably constrain the capabilities reachable through permitted modules and their public attributes. The runner then passes user-influenced code to exec(), allowing the supplied program to access process, operating-system, and filesystem operations. This maps primarily to CWE-78: Improper Neutralization of Special Elements used in an OS Command, with related characteristics of CWE-94: Improper Control of Generation of Code and CWE-693: Protection Mechanism Failure.

Potential impact

  • An attacker could execute operating-system commands as the backend application user
  • An attacker may read, create, modify, or delete files accessible to that account
  • Application secrets, workflow data, or environment-held credentials could be exposed
  • The backend service could be disrupted or altered
  • Compromise could enable further movement depending on service permissions and network access
  • An attacker could execute operating-system commands as the backend application user
  • An attacker may read, create, modify, or delete files accessible to that account
  • Application secrets, workflow data, or environment-held credentials could be exposed
  • The backend service could be disrupted or altered
  • Compromise could enable further movement depending on service permissions and network access

General mitigation guidance

Mitigation generally focuses on preventing untrusted workflow authors from executing general-purpose Python in the backend process.

Common defensive patterns include:

  • Prefer narrowly scoped, declarative tools over arbitrary Python execution
  • Run user-controlled code in a strongly isolated execution boundary rather than the application process
  • Use allowlisted capabilities and APIs instead of blacklist-based import or syntax filtering
  • Apply strict resource, filesystem, network, and subprocess restrictions to the execution environment
  • Run workers with dedicated low-privilege identities and minimal access to secrets and host resources
  • Enforce authorization and approval controls for workflow creation and tool modification
  • Treat workflow definitions and tool code as untrusted input throughout their lifecycle

Mitigation generally focuses on preventing untrusted workflow authors from executing general-purpose Python in the backend process.

Common defensive patterns include:

  • Prefer narrowly scoped, declarative tools over arbitrary Python execution
  • Run user-controlled code in a strongly isolated execution boundary rather than the application process
  • Use allowlisted capabilities and APIs instead of blacklist-based import or syntax filtering
  • Apply strict resource, filesystem, network, and subprocess restrictions to the execution environment
  • Run workers with dedicated low-privilege identities and minimal access to secrets and host resources
  • Enforce authorization and approval controls for workflow creation and tool modification
  • Treat workflow definitions and tool code as untrusted input throughout their lifecycle

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings involving exec(), dynamic code generation, unrestricted Python tool runners, or blacklist-based sandbox checks
  • Code-review signals showing user-controlled workflow content reaching interpreters or process, filesystem, and subprocess APIs
  • Policy rules that prohibit arbitrary code execution inside application services
  • Runtime telemetry for unexpected child processes, filesystem changes, command interpreters, or outbound connections from workflow workers
  • Access reviews for users who can create or edit workflows and custom tools

Automated code-review and software-composition tools may help identify dangerous execution patterns, but should be combined with architecture and runtime controls.

Organizations can look for:

  • Static-analysis findings involving exec(), dynamic code generation, unrestricted Python tool runners, or blacklist-based sandbox checks
  • Code-review signals showing user-controlled workflow content reaching interpreters or process, filesystem, and subprocess APIs
  • Policy rules that prohibit arbitrary code execution inside application services
  • Runtime telemetry for unexpected child processes, filesystem changes, command interpreters, or outbound connections from workflow workers
  • Access reviews for users who can create or edit workflows and custom tools

Automated code-review and software-composition tools may help identify dangerous execution patterns, but should be combined with architecture and runtime controls.

Sources

SourceLink
github.comgithub.com/heymrun/heym/commit/b36d795c6ea841b8f1b511a0952e274487ee4ef3
github.comgithub.com/heymrun/heym/releases/tag/v0.0.40
github.comgithub.com/heymrun/heym/security/advisories/GHSA-wcgw-9hfw-f6f2

Frequently asked

questions

It can be exploitable through the Heym application when an attacker has authenticated access to create or edit a workflow containing an Agent custom Python tool. Portal workflow triggering by itself does not necessarily grant the ability to control executed code.

The key prerequisite is authorization to create or modify a workflow with the affected custom tool. Whether self-registration makes this reachable depends on the deployment's account and workflow permissions.

Avoid executing user-controlled Python inside the backend process. Prefer declarative tools or a strongly isolated, least-privileged execution environment with narrowly allowlisted capabilities.

Do not rely on blacklist-based sandboxing for general-purpose languages. Enforce authorization around workflow changes, apply static and runtime policy checks, and monitor executions for unexpected process, filesystem, and network activity.

It can be exploitable through the Heym application when an attacker has authenticated access to create or edit a workflow containing an Agent custom Python tool. Portal workflow triggering by itself does not necessarily grant the ability to control executed code.

The key prerequisite is authorization to create or modify a workflow with the affected custom tool. Whether self-registration makes this reachable depends on the deployment's account and workflow permissions.

Avoid executing user-controlled Python inside the backend process. Prefer declarative tools or a strongly isolated, least-privileged execution environment with narrowly allowlisted capabilities.

Do not rely on blacklist-based sandboxing for general-purpose languages. Enforce authorization around workflow changes, apply static and runtime policy checks, and monitor executions for unexpected process, filesystem, and network activity.

Find out what's already
exploitable in your codebase.