Skip to content

fix: set generate-authors shell command built from environment values #2471

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 11, 2025

import { execSync } from 'child_process';

return execSync(
`git log --reverse --format='%aN <%aE>' --use-mailmap -- ${packagePath}`,

Fix the issue should avoid dynamically constructing the shell command as a single string. Instead, we can use execFileSync, which allows us to pass the command and its arguments separately. This approach ensures that the arguments are not interpreted by the shell, mitigating the risk of command injection.

Specifically:

  1. Replace the use of execSync with execFileSync in the getAuthorsGitLog function.
  2. Pass the git command and its arguments as separate parameters to execFileSync.
  3. Ensure that packagePath is passed as an argument, rather than interpolated into the command string.

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