GH#3603: fix critical quality-debt from PR #436 review feedback#4338
GH#3603: fix critical quality-debt from PR #436 review feedback#4338alex-solovyev merged 2 commits intomainfrom
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Mar 13 02:48:23 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
Dispatching worker for failing CI remediation.
|
|
Dispatching worker for failing CI remediation.\n- Model: default alternating headless provider\n- Branch: bugfix/GH-3603-wp-helper-command-injection\n- Scope: diagnose failing checks and implement smallest correct fix to make CI pass\n- Attempt: 1 of 1\n- Direction: preserve existing PR scope and keep issue linkage intact |
|
Initial worker launch validation failed; re-dispatching immediately with explicit provider fallback.\n- Correction: relaunch using openai/gpt-5.3-codex\n- Reason: launch gate reported invalid startup for previous attempt |
|
PR has merge conflicts (DIRTY) after sibling PRs merged. Dispatching worker to rebase.
|
… injection GH#3603: The PR #436 refactor of wp-helper.sh introduced a command injection vulnerability by interpolating $wp_command directly into the SSH remote command string without quoting. If wp_command contained shell metacharacters (e.g. semicolons, backticks, $(...)), they would be interpreted by the remote shell. Fix: use printf '%q ' to shell-quote each word of wp_command before embedding it in the remote command string. The localwp case (local execution via cd+wp) is unaffected as it uses word-splitting intentionally for direct execution. ShellCheck -S error passes.
5106f2a to
e5c4263
Compare
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Fri Mar 13 07:05:30 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|



Summary
Fixes the command injection vulnerability in
wp-helper.shidentified by Gemini Code Assist in the PR #436 review.Root Cause
PR #436 refactored
build_ssh_command→execute_wp_via_sshto eliminateeval, but the replacement code interpolated$wp_commanddirectly into the SSH remote command string without quoting:If
$wp_commandcontained shell metacharacters (;,`,$(...),&&,||, etc.), they would be interpreted by the remote shell — a command injection vulnerability.Fix
Quote each word of
$wp_commandusingprintf '%q 'before embedding it in the remote command string:The
localwpcase (direct local execution via subshell) is unaffected — it uses intentional word-splitting for directwpinvocation, not a shell-interpreted string.Verification
shellcheck -S error .agents/scripts/wp-helper.shpasses with no errorsplugin list --format=json) are unaffected:printf '%q 'quotes them safelyplugin list; rm -rf /) is neutralised: the semicolon becomes\;in the remote commandCloses #3603