Category

Cwe 78

Security vulnerabilities and automated fixes for cwe 78 issues

45 posts found

critical8 min

How Command Injection happens in Rust-generated Python scripts and how to fix it

A critical command injection vulnerability (CWE-78) was discovered in the Linux automation module of the `goose-mcp` crate, where Rust code generated Python scripts that passed user-controlled commands directly to `subprocess.run()` with `shell=True`. An attacker who could influence the `commands` parameter in `execute_system_script()` could inject arbitrary shell commands using metacharacters like `;`, `|`, or backticks. The fix replaces `shell=True` with `shlex.split()` and `shell=False`, and

#command-injection#rust#python+3 more
A
anupamme
Aug 26, 2026
critical8 min

How Command Injection happens in Node.js CLI scripts and how to fix it

A Node.js CLI script in `scripts/refresh-htv-signature.js` accepted a user-controlled `slug` argument from `process.argv` and interpolated it directly into a URL string without any validation. While the immediate usage was an HTTP request via `axios.get()`, the absence of input sanitization created a pathway for command injection in current and future code paths. The fix adds a strict allowlist regex that rejects any slug not matching `[a-zA-Z0-9_-]+` before it can reach any downstream operation

#command-injection#javascript#nodejs+3 more
A
anupamme
Aug 26, 2026
critical9 min

How Command Injection happens in Shell Scripts and how to fix it

A command injection vulnerability in `update-po.sh` allowed maliciously crafted filenames in `po/POTFILES.in` to be interpreted as shell commands via unquoted command substitution. The fix replaces `$(cat po/POTFILES.in)` with `xgettext`'s native `--files-from=` flag, eliminating the shell word-splitting attack surface entirely. This is a textbook example of how a single unquoted substitution can become a dangerous exploit primitive.

#command-injection#bash#shell-script+3 more
A
anupamme
Aug 26, 2026
high8 min

How Command Injection happens in PHP and how to fix it

A high-severity command injection vulnerability was discovered in `lib/Controller/Helper.php` where the `corruptline()` method used `exec()` to run sed and awk commands with user-controlled input. The fix replaced all shell command execution with native PHP file operations using `SplFileObject`, eliminating the command injection attack surface entirely.

#php#command-injection#security+4 more
A
anupamme
Aug 22, 2026
high5 min

How javascript.lang.security.detect-child-process.detect-child-process happens in Node.js and how to fix it

A command injection vulnerability was discovered in the audio processing plugin `audioedit.js`, where user-controlled input from downloaded media files was passed directly to shell commands via `exec()`. The fix replaces dangerous shell string interpolation with `execFile()` and argument arrays, eliminating the command injection attack surface entirely.

#security#command-injection#nodejs+4 more
A
anupamme
Aug 22, 2026
high6 min

How Command Injection Happens in Node.js child_process and How to Fix It

A high-severity command injection vulnerability was discovered in `core/cli.js` where the `execSync()` function was called with user-controllable input without proper sanitization. This could allow attackers to execute arbitrary system commands. The fix implements defensive hardening by explicitly marking and validating the dangerous code path to prevent exploitation.

#javascript#nodejs#command-injection+4 more
A
anupamme
Aug 22, 2026
high6 min

How command injection happens in Node.js child_process and how to fix it

A high-severity command injection vulnerability was discovered in `hooks/scripts/auto-stage.js` where the `stageFile()` function used `execSync()` with string interpolation to execute git commands. By switching from `execSync()` with template strings to `spawnSync()` with argument arrays, the fix eliminates shell interpretation and prevents attackers from injecting malicious commands through crafted file paths.

#command-injection#nodejs#child-process+4 more
A
anupamme
Aug 21, 2026
high5 min

How javascript.lang.security.detect-child-process.detect-child-process happens in Node.js and how to fix it

A high-severity command injection vulnerability was discovered in the `scripts/build.cjs` file where `cp.exec()` was used to execute commands from a function argument. This pattern could allow attackers to inject malicious shell commands if the input were ever user-controllable. The fix replaced `cp.exec()` with `cp.execFile()`, eliminating the shell interpretation that makes command injection possible.

#security#command-injection#nodejs+4 more
A
anupamme
Aug 20, 2026
high8 min

How Command Injection via Child Process Happens in Node.js and How to Fix It

A high-severity command injection vulnerability was discovered in `events/console/line.js` where user-controlled input was passed directly to `child_process.exec()`. The fix replaces the dangerous `exec()` function with the safer `execFile()` API, implements a strict whitelist of allowed commands, and adds comprehensive argument validation to prevent remote code execution.

#command-injection#node.js#child-process+4 more
A
anupamme
Aug 20, 2026
critical6 min

How Command Injection via Unsanitized CLI Arguments Happens in Node.js and How to Fix It

A critical input validation vulnerability was discovered in `bin/vibe-to-ui.js` where command-line arguments from `process.argv` were reflected directly into error messages without sanitization. This defensive gap could allow attackers controlling CLI arguments—via CI/CD pipelines, wrapper scripts, or compromised environments—to inject malicious content. The fix introduces a strict allowlist regex and length cap to neutralize dangerous characters before any argument is used.

#security#command-injection#nodejs+4 more
A
anupamme
Aug 20, 2026
high5 min

How run-shell-injection happens in GitHub Actions and how to fix it

A high-severity shell injection vulnerability was discovered in `setup-js/action.yml` where direct interpolation of `inputs.package-manager` in a `run:` step could allow attackers to execute arbitrary code on the GitHub Actions runner. The fix introduces intermediate environment variables to safely pass user-controlled inputs, preventing command injection while maintaining the same functionality.

#github-actions#shell-injection#ci-cd-security+4 more
A
anupamme
Aug 18, 2026
critical6 min

How Command Injection happens in Node.js child_process and how to fix it

A critical command injection vulnerability was discovered in `Plugins/converter.js` where `exec()` was used to invoke ffmpeg with unsanitized user-controlled input. By switching from `exec()` to `execFile()` with an argument array, the fix eliminates shell interpretation and prevents attackers from injecting arbitrary commands through media file paths.

#command-injection#javascript#nodejs+4 more
A
anupamme
Aug 18, 2026