T09 · Insecure Skill Coding Practices
- Location
scripts/forge-client.sh:3- Finding
Unvalidated API endpoint permits credential and financial-data exfiltration
- Content
View full analysis
&2 || { echo "❌ Signup failed" >&2; exit 1; } fi [ -z "$API_KEY" ] && { echo "❌ Set LEDGERAI_API_KEY or LEDGERAI_EMAIL" >&2; exit 1; } ACTION="${1:-help}"; shift || true case "$ACTION" in invoice) curl -sf -X POST "$API_BASE/v1/invoices/process" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "$1" ;; expenses) curl -sf -X POST "$API_BASE/v1/expenses/categorize" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "$1" ;; report) curl -sf -X POST "$API_BASE/v1/reports/generate" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "$1" ;; health) curl -sf "$API_BASE/v1/health" ;; esac ``` ### Technical Analysis The script allows `LEDGERAI_API_URL` to replace the expected LedgerAI origin without validating the URL scheme or hostname. The selected endpoint receives signup emails, bearer credentials, invoice contents, expense records, and financial-report input. An attacker who can influence the process environment can set the variable to an attacker-controlled HTTP or HTTPS server. Because plaintext HTTP is also accepted, a network attacker may additionally intercept sensitive requests when an insecure endpoint is configured. Shell quoting prevents the URL value from directly producing shell command injection, but it does not prevent the script from intentionally transmi ...[truncated 1296 chars]- Remediation
View remediation
