T09 · Insecure Skill Coding Practices
- Location
SKILL.md:43- Finding
Shell Command Injection Through Unquoted User-Controlled Arguments
- Content
View full analysis
0 else 0 kelly_f = max(kelly_f, 0) # never negative implied_prob = 1 / decimal_odds edge = true_prob - implied_prob print(f'Odds: {odds_input} (decimal: {decimal_odds:.4f})') print(f'Implied prob: {implied_prob:.2%} | Your estimate: {true_prob:.2%} | Edge: {edge:.2%}') print(f'Kelly fraction: {kelly_f:.4f} ({kelly_f:.2%} of bankroll)') print(f'Recommended stake: \${kelly_f * bankroll:.2f} of \${bankroll:.2f} bankroll') if kelly_f <= 0: print('⚠️ No edge detected — Kelly says do not bet') elif kelly_f > 0.10: print('⚠️ Kelly > 10% — consider fractional Kelly to reduce variance') " BANKROLL ODDS TRUE_PROB ``` ### Technical Analysis The documented operation expects `BANKROLL`, `ODDS`, and `TRUE_PROB` to be replaced with values derived from user input. These placeholders are not enclosed in shell-safe quotes, and the instructions do not require validation before constructing the command. Although the Python code converts the values with `float()` and `int()`, those conversions occur only after the shell has parsed the command. Consequently, Python-side numeric conversion cannot prevent shell metacharacters in a substituted value from being interpreted by the shell. For example, replacing `BANKROLL` with a value containing `;`, command substitution syntax, redirection operators, or another sh ...[truncated 1907 chars]- Remediation
View remediation
