Skip to content

fix: prevent shell injection in python hooks#55

Open
echobt wants to merge 1 commit intomainfrom
fix/issue-189
Open

fix: prevent shell injection in python hooks#55
echobt wants to merge 1 commit intomainfrom
fix/issue-189

Conversation

@echobt
Copy link
Copy Markdown
Contributor

@echobt echobt commented Jan 21, 2026

Description

This PR addresses a shell command injection vulnerability in install_droid() where python hook paths were directly interpolated into command strings using format!. If the path contained shell metacharacters, it could lead to arbitrary command execution.

Fix

  • Changed the command execution from a string (which is parsed by the shell) to an array of arguments (which is passed directly to the process).
  • Replaced format!("python3 \"{}\"", path.display()) with ["python3", path.display().to_string()].

Verification

  • This change ensures that the path is treated as a single argument to python3, preventing any shell interpretation of special characters within the path.
  • Existing tests 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.

1 participant