T09 · Insecure Skill Coding Practices
- Location
scripts/script.sh:55- Finding
Unvalidated Numeric Inputs Cause Denial of Service
- Content
View full analysis
0 else 0 mer = revenue / spend # Marketing Efficiency Ratio breakeven_roas = 1 / (1 - cogs_pct/100 - fee_pct) ``` ```python current_margin = (current - cost) / current * 100 if current > 0 else 0 target_price = cost / (1 - target_margin/100) comp_margin = (comp - cost) / comp * 100 if comp > 0 else 0 print(f"\n{'═'*50}") print(f"PRICING ANALYSIS") print(f"{'═'*50}\n") print(f" Cost: ${cost:.2f}") print(f" Current Price: ${current:.2f} (margin: {current_margin:.1f}%)") print(f" Competitor Price: ${comp:.2f} (their margin est: {comp_margin:.1f}%)") print(f" Target Margin: {target_margin:.0f}%") print() print(f" TARGET PRICE: ${target_price:.2f}") print() print(" PRICING STRATEGY OPTIONS:") if target_price > comp * 1.1: print(f" → Premium pricing at ${target_price:.2f} (+{(target_price/comp-1)*100:.0f}% vs competitor)") print(f" Requires strong differentiation (brand, reviews, features)") elif target_price < comp * 0.95: print(f" → Competitive pricing at ${target_price:.2f} (-{(1-target_price/comp)*100:.0f}% vs competitor)") ``` ### Technical Analysis Numeric command-line parameters are converted to Python numeric types without comprehensive validation. Several user-controlled values are subsequently used as divisors without ensuring that they are nonzero and within valid business ranges. The Bash variables are commonly initialized to `0`, while checks such as `[[ -z "$spend" ]]` only test whether a string is empty. The string `"0"` and default value `0` therefore pass these checks. Relevant failur ...[truncated 2131 chars]- Remediation
View remediation
