Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

odaysec
Copy link
Contributor

@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.

Copy link
Collaborator

@addaleax addaleax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just going to point out that while there's nothing inherently wrong with this PR, it is effectively a no-op and just adds noise for maintainers, since the way this script is used ensures that it only operates on known and trusted inputs

@addaleax addaleax merged commit aaca8df into mongodb-js:main Jun 16, 2025
124 of 132 checks passed
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.