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 May 15, 2025

const proc = spawn(editor, [path.basename(tmpDoc)], {
stdio: 'inherit',
cwd: path.dirname(tmpDoc),
shell: true,

fix the issue should avoid using shell: true and instead pass the command and its arguments as an array to the spawn function. This ensures that the arguments are not interpreted by the shell, mitigating the risk of shell injection. Specifically:

  1. Replace the spawn call with a version that does not use shell: true.
  2. Pass the full path to the editor and the temporary file as separate arguments to spawn.

This approach ensures that the command is executed directly without shell interpretation, making it safe from injection attacks.

@addaleax
Copy link
Collaborator

@odaysec It seems you are creating pull requests across multiple GitHub repositories, potentially based on detecting specific patterns in source code automatically. Unfortunately, it also seems that you are not taking into account the circumstances under which the code in question runs, and what its intended behavior would be. I will close this PR and #2454 as they do not appear to be targeting legitimate vulnerabilities in this software.

For the future, please be encouraged to bring up genuine security issues, but be advised that opening PRs across a broad set of repositories automatically without understanding the target source code will generally not help your reputation as a security researcher, and rather will put your PRs at risk of being marked as spam and reported to GitHub.

@addaleax addaleax closed this May 15, 2025
@odaysec odaysec deleted the patch-2 branch May 15, 2025 11:30
@jacopotediosi
Copy link

Things like this make legitimate security researchers look bad. It's a shame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

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