Summary
OpenChoreo Workflow Plane templates can place developer-controlled workflow parameters directly into shell program text executed through sh -c, creating an operating system command injection risk. An attacker who can influence those parameters may execute arbitrary commands inside workflow pods, with impact potentially increased when privileged Podman templates do not isolate users from the host.
Affected context
The issue occurs in OpenChoreo Workflow Plane templates under samples/getting-started/workflow-templates/ when workflow parameters controlled by developers are interpolated into shell source rather than passed as container environment values or other data-only inputs. The risk is greater in deployments using privileged Podman-based templates without user-namespace isolation, although actual impact depends on pod permissions, runtime configuration, and available cluster controls.
Exploit preconditions
- Attack surface: OpenChoreo Workflow Plane template execution
- Required access: The ability to create, modify, or trigger workflows with attacker-influenced parameter values
- Trigger point: Rendering and execution of a workflow command through
sh -c - Why exploitation is possible: Parameter data becomes part of shell program text, allowing shell metacharacters or command syntax to alter the intended command flow
- Privilege considerations: Impact may increase when workflow pods use privileged container runtimes or lack host-user isolation
Why this happens
The underlying bug is the unsafe construction of shell commands from untrusted or insufficiently trusted workflow parameters. Interpolating values into a command string causes data to be interpreted as shell syntax when the resulting text is executed through sh -c, rather than remaining a literal argument.
This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection. The related container configuration weakness is a separate defense-in-depth concern: privileged execution and missing user isolation can expand the consequences of command execution.
Potential impact
- An attacker may execute arbitrary commands inside a workflow pod.
- Sensitive environment variables, mounted files, or service credentials could be exposed.
- Workflow outputs or build artifacts could be modified or poisoned.
- The attacker could use available permissions to affect Kubernetes resources or connected services.
- Privileged runtime settings could increase the risk of host or cluster compromise.
General mitigation guidance
Mitigation generally focuses on ensuring workflow parameters remain data rather than executable shell source.
Common defensive patterns include:
- Pass parameters through structured process arguments or container environment variables instead of interpolating them into shell text.
- Avoid invoking a shell when direct executable invocation can provide equivalent behavior.
- Apply strict allowlists, type constraints, and schema validation to workflow inputs.
- Use context-appropriate escaping only as a supplementary control, not as a substitute for separating data from commands.
- Run workflow pods with least privilege, non-root identities, restricted capabilities, and user isolation where supported.
- Limit service-account permissions, mounted credentials, filesystem access, and network reachability.
- Treat workflow templates and generated execution specifications as protected deployment configuration.
How teams detect issues like this
Detection approaches can include:
- Static analysis for string interpolation, concatenation, or templating used to construct arguments passed to
sh -c, shell interpreters, or command-execution APIs. - Code review checks for developer-controlled values embedded in shell program text.
- Policy enforcement requiring structured argument passing and prohibiting unnecessary shell invocation in workflow templates.
- Admission or configuration checks for privileged containers, excessive capabilities, root execution, and missing user-isolation settings.
- Runtime monitoring for unexpected child processes, command interpreters, file changes, or access to sensitive Kubernetes and cloud resources from workflow pods.
- Automated security review tools can help identify shell construction and container privilege patterns during CI.

