T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:43
- Finding
- Authentication Cookie Exposure Through Command Arguments and Redirects## Vulnerability Details **File Location**: `SKILL.md`, lines 43-44 **Vulnerability Type**: Sensitive credential exposure **Risk Level**: Medium **Vulnerable Code**: ```bash curl -L -o /tmp/torrent.torrent "https://pt.example.com/download.php?id=123" \ -H "Cookie: c_secure_uid=xxx; c_secure_pass=xxx" ``` ### Technical Analysis The documented download command places the private tracker's authentication cookie directly in curl's command-line arguments. Although authenticated access is necessary for the declared private-tracker functionality, exposing the complete cookie in a command argument is not the minimum-risk way to provide that access. Command arguments may be captured by local process inspection, shell history, debugging output, audit systems, or agent and tool execution logs. The cookie may provide access equivalent to the user's authenticated tracker session and could also contain or lead to disclosure of a personal tracker passkey. The command additionally uses `curl -L` while supplying an explicit `Cookie` header. Custom sensitive headers can create credential-forwarding risk during redirects, particularly if a compromised or misconfigured tracker redirects the request to a different origin. The workflow does not validate the redirect destination or require it to remain on the configured HTTPS tracker origin. ### Attack Path 1. The Skill reads an authentication cookie from `~/.clawdbot/credentials/pt-site/sites.json`. 2. The cookie is interpolated into the documented curl command as an explicit command-line argument. 3. A local process observer, command logger, shell-history collector, or agent telemetry system records the command and extracts the cookie. 4. The attacker submits the captured cookie to the private tracker and impersonates the user's authenticated session. 5. Alternatively, a compromised tracker endpoint issues a redirect to an attacker-controlled origin; the use of an explicit sensitive head ...[truncated 722 chars]
- Remediation
- ## Remediation Suggestions - Do not place authentication cookies directly in command-line arguments. - Supply credentials through a permission-restricted cookie file or curl configuration file created in a private temporary directory. - Set file permissions to owner-only access, such as mode `0600`, and securely remove temporary credential material after use. - Avoid logging commands containing cookies, passkeys, or authenticated download URLs. - Disable redirects unless required. If redirects are necessary, validate every destination and require the final URL to use HTTPS and match the configured tracker host. - Reject tracker URLs containing unexpected schemes, user information, ports, or hosts before making authenticated requests. - Redact cookie values and passkeys from error messages, debugging output, and agent telemetry. - Use short-lived or revocable credentials where supported by the tracker.
