T09 · Insecure Skill Coding Practices
Warning
- Location
- references/api-security.md:31
- Finding
- Unbounded High-Impact and Disruptive Security Testing Procedures<![CDATA[ ## Vulnerability Details **File Locations**: - `SKILL.md:64-81` — destructive SQL injection and command-injection payloads - `SKILL.md:86-94` — repeated authentication attempts - `references/api-security.md:31-43` — high-volume requests and a 10 MB upload - `references/api-security.md:51-65` — SSRF probes against internal and cloud metadata addresses - `references/api-security.md:103-110` — GraphQL resource-exhaustion procedures - `references/owasp-top10-tests.md:132-140` — probes for sensitive configuration and diagnostic resources **Vulnerability Type**: Security-testing instructions lack authorization, scope, rate, and destructive-action safeguards **Risk Level**: Medium ### Vulnerable Code `SKILL.md:64-81`: ```bash # SQL Injection (OWASP-DV-005) # Reference: CWE-89 PAYLOADS=( "' OR '1'='1" "' OR '1'='1' --" "'; DROP TABLE users; --" "' UNION SELECT null,null,null --" "1' AND SLEEP(5) --" ) for p in "${PAYLOADS[@]}"; do echo "Testing: $p" curl -s -o /dev/null -w "%{http_code} %{time_total}s" \ "$URL/api/search?q=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$p'))")" echo done # Command Injection (CWE-78) CMD_PAYLOADS=( '; ls -la' '| cat /etc/passwd' '$(whoami)' '`id`' ) ``` `SKILL.md:86-94`: ```bash # Brute force protection (OWASP-AT-004) for i in $(seq 1 20); do STATUS=$(curl -s -o /dev/null -w "%{http_code}" \ -X POST "$URL/api/login" \ -H "Content-Type: application/json" \ -d "{\"username\":\"admin\",\"password\":\"wrong$i\"}") echo "Attempt $i: $STATUS" # After 5-10 attempts, should see 429 or account lockout done ``` `references/api-security.md:31-43`: ```bash # Test missing pagination limits curl "$URL/api/items?page=1&per_page=999999" # Should enforce max per_page # Test missing rate limits for i in $(seq 1 200); do curl -s -o /dev/null -w "%{http_code}\n" "$URL/api/expensive-endpoint" done | sort | uniq -c # Should see 429 responses # Test large payload python3 -c "pri ...[truncated 4973 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require explicit confirmation that the operator owns the target or has written authorization to test it. 2. Require an allowlist of approved schemes, hosts, ports, and paths. Reject redirects or resolved addresses that leave the approved scope. 3. Make passive and non-destructive checks the default. Place brute-force, SSRF, resource-exhaustion, large-payload, and state-changing tests behind separate confirmations. 4. Replace destructive payloads such as `DROP TABLE` with inert markers designed only to demonstrate parsing behavior. 5. Use harmless command-injection markers, such as a fixed echo token, rather than reading operating-system files. 6. Define conservative request limits, including maximum request count, concurrency, payload size, test duration, and response size. 7. Explicitly prohibit denial-of-service and account-lockout testing against production systems. 8. Disable cloud metadata probes by default. If specifically authorized, use a controlled canary service rather than a real metadata endpoint. 9. Require dedicated test accounts and test data for authentication, authorization, mass-assignment, and business-logic checks. 10. Stop testing automatically when lockout behavior, elevated latency, server errors, or availability degradation is detected. 11. Prevent sensitive response bodies from being printed by default. Redact authorization headers, tokens, cookies, credentials, personal data, environment variables, and cloud metadata from logs and reports. 12. Add a mandatory preflight section documenting authorization, target scope, excluded assets, maintenance window, emergency contacts, rollback procedures, and approved test intensity. ]]>
