Skip to content

fix(security): Sanitize all path-like segments in terminal sendText#202

Merged
azmkercso merged 1 commit intoaws:mainfrom
aakashmandavilli96:main
Apr 20, 2026
Merged

fix(security): Sanitize all path-like segments in terminal sendText#202
azmkercso merged 1 commit intoaws:mainfrom
aakashmandavilli96:main

Conversation

@aakashmandavilli96
Copy link
Copy Markdown
Contributor

Broaden sanitizeCdPathsInCommand() to escape command substitution patterns ($(), ${}, backticks) in all path-like tokens, not just cd arguments. Also strips newlines and null bytes to prevent line splitting injection.

Issue

  • P381721885

Description of Changes

  • Sanitize folder paths

Testing

  • Applied patches successfully and validated using BYOI

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.

Broaden sanitizeCdPathsInCommand() to escape command substitution
patterns ($(), ${}, backticks) in all path-like tokens, not just
cd arguments. Also strips newlines and null bytes to prevent line
splitting injection.
@aakashmandavilli96 aakashmandavilli96 requested review from a team as code owners April 20, 2026 07:28
Copy link
Copy Markdown
Contributor

@azmkercso azmkercso left a comment

Choose a reason for hiding this comment

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

Looks good to me, verified the rules and the behaviour of the regex-based replacements.

@azmkercso azmkercso merged commit 527b20d into aws:main Apr 20, 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.

4 participants