Summary
Heym's Playwright step-mode node inserts workflow values directly into generated Python source, which can allow crafted values to alter the code being executed. An authenticated non-admin user who can supply step values that reach this node may be able to run arbitrary Python as root inside the backend container.
Affected context
The issue affects Heym deployments using the Playwright step-mode node in versions before 0.0.142. It becomes risky when workflow values supplied by a user are substituted into Python source without safe separation between data and executable code.
Exploit preconditions
- Attack surface: The backend's workflow execution path using the Playwright step-mode node
- Required access: An authenticated non-admin account able to provide or modify relevant step field values
- Trigger point: Processing and execution of generated Python for a workflow step
- Why exploitation is possible: Values are inserted into source code in a way that can allow them to escape string literals and be interpreted as Python code
Why this happens
The underlying bug is code generation from values that are not safely treated as data. Substituting workflow values directly into Python source can allow input to change the program's structure or behavior, which maps to CWE-94: Improper Control of Generation of Code.
Potential impact
- An attacker may execute arbitrary Python code in the backend container.
- Code execution could occur with root privileges inside that container.
- An attacker could access or alter data available to the backend process.
- The container or connected services could be further compromised, depending on permissions and isolation.
General mitigation guidance
Mitigation patterns focus on keeping user-controlled values separate from executable code.
- Prefer fixed, parameterized execution interfaces over generating source code from workflow values.
- Treat workflow fields as untrusted, and validate them against narrow schemas and allowed types.
- Where code generation cannot be avoided, use context-appropriate escaping and tightly constrain supported expressions.
- Run backend processes with least privilege, and limit container access to files, credentials, and services.
- Use isolation controls to reduce the impact of code execution within a container.
How teams detect issues like this
Review code paths that interpolate workflow fields or other user-controlled values into Python source, especially around expression resolution and step execution. Static analysis can flag dynamic code construction and execution APIs; code reviews can check whether values remain data rather than becoming source syntax. CI policies can restrict dynamic evaluation and require validation of workflow inputs. Automated code review tools may help identify these patterns.

