The vulnerability is a command injection flaw within the Nuclio Shell Runtime, identified as CVE-2026-29042. The root cause is the improper handling of user-supplied arguments passed through the X-Nuclio-Arguments HTTP header. The analysis of the patch commit 5352d7e16cf92f4350a2f8d806c4b80b626b5c5a confirms the vulnerability and its fix.
The vulnerability unfolds in two stages:
- Input Injection: The
shell.getCommandArguments function in pkg/processor/runtime/shell/runtime.go reads the X-Nuclio-Arguments header value without any sanitization or validation. This allows an attacker to include shell metacharacters (e.g., ;, |, $()) in the header.
- Command Execution: The
shell.processEvent function receives these arguments. When the configured handler is a command found in the system's PATH, it constructs a command string by joining the command and the user-supplied arguments. This string is then executed using sh -c, which interprets the injected shell metacharacters, allowing the attacker to execute arbitrary commands.
The patch addresses the vulnerability by modifying shell.processEvent to no longer use sh -c. Instead, it executes the command directly and passes the arguments as a separate slice (exec.CommandContext(context, command[0], command[1:]...)). This ensures that the arguments are treated as literal strings by the operating system and not interpreted by a shell, thus preventing command injection. Both getCommandArguments and processEvent are critical functions that would appear in a runtime profile during exploitation.