Skip to content

Improve shell path escaping in CLI to prevent command injection#176

Open
RinZ27 wants to merge 1 commit intoblackboardsh:mainfrom
RinZ27:fix/cli-shell-injection
Open

Improve shell path escaping in CLI to prevent command injection#176
RinZ27 wants to merge 1 commit intoblackboardsh:mainfrom
RinZ27:fix/cli-shell-injection

Conversation

@RinZ27
Copy link

@RinZ27 RinZ27 commented Feb 21, 2026

Vulnerability in path escaping was noticed where only double quotes were being handled. Since the CLI uses string templates with shell-execution functions like execSync, characters such as backticks or dollar signs in file paths could lead to arbitrary command execution on a developer's machine.

Switching to single quotes for POSIX systems provides a much more robust shield against shell expansion. While double quotes still allow for variable interpolation and command substitution, single quotes neutralize these threats entirely. Additionally, several locations using direct double-quote wrapping were refactored to use the centralized escape utility.

Safety of the build process is significantly improved by this change, especially when dealing with projects or paths containing special characters. My tests confirmed that standard paths continue to work correctly while malicious paths are now safely escaped and do not trigger unexpected shell behavior.

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