Skip to content

πŸ”’ Fix command injection vulnerability in plugin hooks#12

Open
sstklen wants to merge 1 commit into
mainfrom
security-fix-command-injection-4443877766165372816
Open

πŸ”’ Fix command injection vulnerability in plugin hooks#12
sstklen wants to merge 1 commit into
mainfrom
security-fix-command-injection-4443877766165372816

Conversation

@sstklen
Copy link
Copy Markdown
Owner

@sstklen sstklen commented May 18, 2026

🎯 What: Fixed a command injection vulnerability in the Claude plugin configuration where raw user input ($TOOL_INPUT) was directly interpolated into shell command strings.

⚠️ Risk: If an attacker (or the AI itself, maliciously prompted) provides crafted input containing shell metacharacters (e.g., "; rm -rf /;"), the plugin runner could execute arbitrary shell commands on the host machine.

πŸ›‘οΈ Solution: Removed the direct string interpolation from .claude-plugin/plugin.json. Instead, the three hook scripts (pre-bash-guard.sh, post-edit-check.sh, post-deploy-health.sh) were modified to read the TOOL_INPUT value safely from the environment variables by defaulting to ${1:-$TOOL_INPUT}. This relies on the OS environment passing mechanism, completely bypassing the shell string interpolation vulnerability while maintaining backward compatibility for positional arguments.


PR created automatically by Jules for task 4443877766165372816 started by @sstklen

Co-authored-by: sstklen <90471971+sstklen@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown

πŸ‘‹ Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a πŸ‘€ emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

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