Summary
BISHENG before 2.6.0 contains a remote code execution vulnerability in the workflow run_once endpoint. An authenticated user may submit a crafted Code node that is executed with Python exec() without sandboxing, potentially exposing the host filesystem, credentials, and internal network resources.
Affected context
The vulnerability occurs in BISHENG deployments that expose the workflow execution API and permit authenticated users to create or submit Code node definitions. Risk arises when the POST /api/v1/workflow/run_once endpoint executes user-controlled Python code directly, without an effective sandbox or equivalent isolation boundary.
Exploit preconditions
- Attack surface: The BISHENG workflow execution API, specifically
POST /api/v1/workflow/run_once - Required access: Valid authentication and sufficient permission to submit or execute workflow Code nodes
- Trigger point: Processing of a crafted Code node during a one-time workflow run
- Why exploitation is possible: User-controlled Python code is passed to
exec()without sandboxing, allowing execution in the application's runtime context
Why this happens
The underlying bug is server-side execution of untrusted Python code through the exec() function. Because the submitted Code node is not constrained by a secure interpreter, policy-enforced execution environment, or effective sandbox, attacker-controlled instructions can access the process's available resources. This behavior maps to CWE-94: Improper Control of Generation of Code ('Code Injection'), in which externally influenced input is treated as executable program logic.
Potential impact
- An attacker may execute arbitrary Python code under the BISHENG process identity.
- The vulnerability could expose application secrets, credentials, and local files.
- An attacker may modify data or workflows accessible to the compromised process.
- The compromised service could be used to reach internal network resources.
- The incident can enable lateral movement or broader environment compromise, depending on privileges and network access.
General mitigation guidance
Mitigation generally focuses on removing direct execution of untrusted code and reducing the authority available to workflow runtimes.
Common defensive patterns include:
- Replacing unrestricted
exec()behavior with a constrained, declarative workflow model or narrowly defined operation allowlist. - Treating Code node content as untrusted input and applying strong server-side authorization and validation.
- Using meaningful isolation boundaries when dynamic execution is an unavoidable feature, including separate low-privilege workers and restricted filesystem and network access.
- Preventing workflow runners from inheriting unnecessary credentials, tokens, or host capabilities.
- Applying least-privilege identities, resource limits, and restrictive egress policies to execution services.
- Separating workflow authoring permissions from workflow execution permissions and requiring approval for executable content.
How teams detect issues like this
Detection can combine source analysis, runtime monitoring, and authorization review:
- Use static analysis to identify
exec(),eval(), dynamic imports, and equivalent interpreter calls on request- or workflow-derived data. - Review Code node handling for missing sandbox boundaries, weak authorization checks, and direct propagation of submitted source into execution APIs.
- Monitor requests to workflow execution endpoints, especially unusual Code node submissions, repeated one-time runs, and access to sensitive resources by workflow workers.
- Enforce policies that prohibit unrestricted dynamic code execution in web-facing services or require approved isolated execution components.
- Use automated security review tools as a supplementary control for identifying dangerous sinks and untrusted data flows.

