Skip to content

fix shell command built from environment values #584

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

odaysec
Copy link

@odaysec odaysec commented Jun 2, 2025

import { exec as execCb } from "node:child_process";

await exec(`tar xf ${ffmpegZipPath} -C ${targetDir}`);

Fix the issue, the shell command should be refactored to avoid dynamic string construction and instead use execFile or execFileSync, which allows passing arguments separately to the command. This approach ensures that the paths are treated as literal arguments and not interpreted by the shell.

Specifically:

  1. Replace the exec call on line 111 with execFile or execFileSync.
  2. Pass the tar command and its arguments as separate parameters, ensuring that ffmpegZipPath and targetDir are treated as literal values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant