T09 · Insecure Skill Coding Practices
- Location
scripts/fetch_data.sh:17- Finding
Unvalidated Download URL Receives the SSO Session Cookie
- Content
View full analysis
/dev/null) if [ -n "$URL" ]; then NAME="data_${AID}.csv" curl -s "$URL" -H "Cookie: $COOKIE" -o "$OUTPUT_DIR/$NAME" ``` ### Technical Analysis The script obtains `fileUrl` from the RedBI API response and supplies it directly to `curl`. It does not parse or validate the URL's scheme, hostname, or port before attaching the reusable SSO cookie. Although the expected download host is documented as `datatools.xhscdn.com`, the script does not enforce that restriction. If the task API, a task record, or an upstream component is compromised, an attacker could return an HTTPS URL under an attacker-controlled domain. Because the `Cookie` header is added manually, normal browser cookie-domain restrictions do not protect it. The same unsafe pattern is documented in `SKILL.md:74-80`. ### Attack Path 1. An attacker compromises or manipulates a RedBI download-task record or its API response. 2. The attacker sets the completed task's `fileUrl` to an attacker-controlled endpoint. 3. The script selects that URL based only on `resourceId` and `FINISHED` status. 4. `curl` requests the attacker-controlled URL and explicitly sends `Cookie: $COOKIE`. 5. The attacker records the SSO cookie and attempts to replay it against services available to that identity. ### I ...[truncated 548 chars]- Remediation
View remediation
