Summary
Nuclio cron triggers may be vulnerable to OS command injection because event header names and event body content flow into a shell command without adequate sanitization. An attacker who can influence these trigger fields may cause arbitrary commands to run in the Kubernetes CronJob container when the scheduled trigger executes.
Affected context
The vulnerability occurs in Nuclio deployments that use cron triggers and generate Kubernetes CronJobs for event processing. The controller constructs a curl command and passes it to /bin/sh -c; values derived from event header keys and the event body may therefore become part of a shell-interpreted command. Risk depends on whether an attacker can influence trigger input or configuration and on the permissions available to the CronJob container.
Exploit preconditions
- Attack surface: Nuclio cron-trigger processing and the resulting Kubernetes CronJob container
- Required access: The ability to influence event header names, event body content, or another upstream source that controls those values
- Trigger point: Execution of the generated shell command by
/bin/sh -cduring a scheduled CronJob run - Why exploitation is possible: User-influenced values are incorporated into a command string without sufficient shell metacharacter handling or command separation
Why this happens
The underlying flaw is command construction from untrusted or insufficiently trusted data. Nuclio builds a curl invocation as a string and executes it through a shell, while event header keys and the event body can flow into that string without adequate sanitization. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because shell syntax embedded in data may alter the intended command structure.
Potential impact
- An attacker may execute arbitrary operating-system commands in the CronJob container.
- The workload may be used to access application data, credentials, or mounted resources.
- The attacker could alter or disrupt event-processing behavior.
- The compromise could enable lateral movement, depending on service-account permissions and network access.
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from data-driven command execution and reducing the trust placed in trigger inputs.
Common defensive patterns include:
- Invoke HTTP clients directly with structured argument arrays rather than passing concatenated commands to
/bin/sh -c. - Treat event header names and bodies as data, using APIs that preserve argument boundaries.
- Apply strict allowlists and schema validation to trigger fields before command construction.
- Avoid accepting attacker-controlled header names where they are not required.
- Run CronJob containers with least-privilege service accounts, restricted capabilities, and minimal filesystem and network access.
- Use read-only filesystems and isolated execution contexts where compatible with the workload.
How teams detect issues like this
Organizations can look for this vulnerability class through:
- Static analysis rules identifying shell execution with concatenated or interpolated values.
- Code review checks for
/bin/sh -c, command-string assembly, and unsanitized event data reaching process execution. - Repository searches for curl or other command-line utilities constructed from trigger fields.
- Policy enforcement requiring structured process APIs and prohibiting shell evaluation for untrusted input.
- Runtime monitoring for unexpected child processes, shell activity, outbound connections, or command execution from CronJob containers.
Automated security review tools may help identify command construction and tainted-data flows during development.

