Skip to content

Conversation

@horner
Copy link
Member

@horner horner commented Sep 4, 2025

Potential fix for https://github.com/mieweb/opensource-server/security/code-scanning/4

The best way to fix this vulnerability is to avoid shell interpolation entirely and instead use an API such as spawn or execFile that takes command arguments as an array, so no shell parsing occurs. This prevents command injection regardless of username/password content.

  • Replace the use of exec with spawn (or execFile), passing the command and its arguments as separate items in an array.
  • Capture the output and error events to preserve the current behavior (send response based on child output).
  • No additional functionality is needed; only the command execution method in /login route handler should be updated.

Required changes:

  • In create-a-container/server.js, line 39: Replace exec with a safe alternative, modifying how output is handled.
  • Potentially add error capturing for spawn/execFile.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@runleveldev
Copy link
Collaborator

Obseleted by #48

@runleveldev runleveldev deleted the alert-autofix-4 branch October 14, 2025 18:37
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.

3 participants