Detect command injection before merge.
See how command injection fits local review, which evidence Code Radar produces, where coverage ends, and how trusted findings move into CI.
radar scan . --quickWhat command injection means here.
The command injection rule identifies review patterns that can create exploitable behavior or hide material maintenance risk, then returns the affected location, severity, confidence, and remediation context.
Evidence to inspect
Use “Detect command injection before merge.” as the scope for this decision: verify the input, finding detail, workflow handoff, and product boundary before you install or buy.
Check this risk locally
Coverage and concrete signals
Detect untrusted input reaching shell execution instead of an argument-safe API.
- Audience: Developers and reviewers deciding how to handle command injection findings before merge.
- Evidence to inspect before you trust the result.: Trace untrusted text into shell execution and verify that the replacement passes fixed arguments through an argument-safe API.
- Boundary: A fixed command with validated arguments may be safe; confirm the executable and argument boundary, then test metacharacters and rejected input.
- Rule ID: RADAR-SEC-CMDI
Risky pattern / Safer pattern
command injection: A useful result must be explainable to a developer and portable to the next review surface. Inspect the concrete evidence below before changing team policy.
From local signal to shared gate.
command injection: Use the smallest workflow that proves value. Each later step should reuse evidence the team already understands. Trace untrusted text into shell execution and verify that the replacement passes fixed arguments through an argument-safe API.
radar scan . --quick
radar scan . --format sarif --fail-on highPrimary sources
Validate the workflow on your own code.
Apply this page’s evidence to one real repository. For “Detect command injection before merge.”, confirm which finding is produced, whether the proposed next step is reproducible, and where local scanning, reports, agents, or CI should stop or expand.