Summary
Heym's Playwright workflow node executes Python code supplied through its playwrightCode field without sandboxing or code validation. An authenticated user who can submit a workflow may be able to run arbitrary commands on the backend host as the service process user.
Affected context
The issue affects Heym deployments whose workflow engine processes a Playwright node containing a playwrightCode value. The backend writes the supplied string to a temporary Python file and executes it as a subprocess without sandboxing, AST validation, or a role gate. The described risk applies to versions before 0.0.71; the default Docker deployment was observed running the service as root.
Exploit preconditions
- Attack surface: Heym's authenticated workflow functionality.
- Required access: An account able to submit or run a workflow; the description states that a freshly registered account can be sufficient.
- Trigger point: Execution of a workflow containing a Playwright node.
- Why exploitation is possible: User-supplied Python code is written to a file and executed by the backend process without isolation or code validation.
Why this happens
The workflow engine treats a user-controlled string as executable Python code and launches it directly in a subprocess. This is code injection: application data crosses into an execution context without an effective boundary restricting what can run, corresponding to CWE-94: Improper Control of Generation of Code.
Potential impact
- An attacker may execute arbitrary code on the backend host with the service process's privileges.
- The service account's data and credentials could be accessed or altered.
- The host or connected systems could be compromised, depending on network access and permissions.
- In deployments where the service runs as root, host-level impact could be more severe.
General mitigation guidance
Common defensive patterns include:
- Avoid executing user-supplied source code; provide constrained, declarative workflow actions instead.
- If code execution is an essential feature, isolate it in a hardened sandbox with strict resource, filesystem, and network controls.
- Enforce authorization and policy checks before accepting or running workflows, and treat all user-submitted code as untrusted.
- Run backend services with least privilege and avoid elevated container or host permissions.
- Apply strict workflow schemas and allowlists, recognizing that validation alone is not a substitute for execution isolation.
How teams detect issues like this
Detection approaches can include:
- Static analysis and code review for subprocess execution of generated or user-controlled files.
- Reviewing workflow handlers for missing authorization checks, sandboxing, and policy enforcement.
- Monitoring backend processes for unexpected Python subprocesses, command execution, or unusual filesystem and network activity.
- Enforcing policies that prohibit direct execution of user-provided code or require approved isolation controls.
- Using automated security review tools to flag untrusted data flowing into execution APIs.

