Skip to content

fix: use array-form sh to prevent shell injection in pr lane#181

Merged
johnson-wang-appier merged 3 commits into
masterfrom
michael/MT-8831/fix-fastlane-shell-injection
Jun 12, 2026
Merged

fix: use array-form sh to prevent shell injection in pr lane#181
johnson-wang-appier merged 3 commits into
masterfrom
michael/MT-8831/fix-fastlane-shell-injection

Conversation

@michael-chang-appier

@michael-chang-appier michael-chang-appier commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace sh "git checkout -b #{branch_name}" with sh ["git", "checkout", "-b", branch_name] in the pr lane
  • Array form bypasses the shell entirely — branch_name is passed as a literal argument to git, so shell metacharacters can't be interpreted

michael-chang-appier and others added 2 commits June 9, 2026 15:20
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
@michael-chang-appier michael-chang-appier changed the title fix: use array-form sh to prevent shell injection in pr lane [MT-8831] fix: use array-form sh to prevent shell injection in pr lane Jun 9, 2026
@michael-chang-appier michael-chang-appier self-assigned this Jun 9, 2026

@johnson-wang-appier johnson-wang-appier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved with static review

…-8831]

Fastlane joins a single-array sh argument back into one shell string and runs
it via /bin/sh -c, so sh(["git", ...]) was still shell-injectable. Variadic
args are passed straight to Open3.popen2e without a shell.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
AI-Ratio: 0.8
@johnson-wang-appier
johnson-wang-appier merged commit 5066a93 into master Jun 12, 2026
8 checks passed
@johnson-wang-appier
johnson-wang-appier deleted the michael/MT-8831/fix-fastlane-shell-injection branch June 12, 2026 01:01
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.

2 participants