Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

thoughtbot/cocaine
master @ e814734
5
Fixes
1
CVEs
CRITICAL
Peak severity
Highlights
Command Injection: 4 prior fixes. Scrutinize any change in this area.
lib/cocaine/command_line.rb: most-fixed (5 issues). Treat as high-risk during review.
4 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Command Injection: Recursive variable interpolation (tracked in CVE-2013-4457) allowed attackers to inject new interpolation markers within user input, which were subsequently parsed and executed during a second replacement pass. A single-pass gsub or strict mapping is required.
Command Injection: Array parameters and special edge characters (such as trailing single quotes) bypass naive shell escaping when they are not mapped individually or when trailing characters are parsed incorrectly during splitting.
Command Injection: Allowing control variables like 'environment' to be dynamically overwritten via user-supplied interpolation keys can alter the execution environment or inject commands.