T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:231
- Finding
- Authenticated Session Cookies Can Be Read and Exported## Vulnerability Details **File Location**: `SKILL.md`, lines 231–245 **Vulnerability Type**: Authentication cookie exposure and insecure credential export **Risk Level**: Medium ### Vulnerable Code ```bash browser-use cookies get # Get all cookies for current session browser-use cookies get --url https://instagram.com # Cookies for specific platform browser-use cookies set <name> <value> # Set a cookie browser-use cookies set name val --domain .instagram.com --secure --http-only browser-use cookies clear --url <url> # Clear cookies for specific URL browser-use cookies export <file> # Export cookies to JSON browser-use cookies import <file> # Import cookies from JSON ``` ```text **Cookie rules:** - Cookie export files should be stored in `~/.browseruse/cookies/`, not in `/tmp/` or world-readable locations - After importing cookies, delete the export file: `rm <file>` - Never export cookies from one platform and import them into a different platform's session - If a session expires, inform the user so they can re-authenticate manually ``` ### Technical Analysis The Skill permits the agent to retrieve authentication cookies into command output and export them as JSON to a caller-selected file. Social-media session cookies are bearer credentials: possession may be sufficient to impersonate the authenticated user without knowing the account password. The documented storage guidance does not technically enforce a fixed destination, restrictive file permissions, encryption, redaction from model context or logs, user confirmation, or automatic deletion. The deletion instruction applies only after an import, so an export created for another reason may remain on disk indefinitely. These capabilities are also unnecessary for most documented workflows, which can rely on browser-managed persistent sessions. ### Attack Path ...[truncated 1329 chars]
- Remediation
- ## Remediation Suggestions 1. Remove `cookies get`, `cookies export`, and `cookies import` from the normal Skill interface when browser-managed session persistence is sufficient. 2. Require explicit, operation-specific user confirmation before reading, exporting, importing, setting, or clearing cookies. 3. Never return raw cookie values to the model context, terminal history, telemetry, or ordinary application logs. 4. If export is indispensable, enforce a fixed private directory rather than accepting arbitrary output paths. 5. Create export files atomically with owner-only permissions such as mode `0600`, reject symbolic links, and verify directory ownership and permissions. 6. Encrypt exported credentials at rest using a user-controlled secret or operating-system credential store. 7. Automatically delete exports immediately after the authorized operation, including failure and cancellation paths. 8. Restrict exports to the minimum required domains and cookie fields, and prevent transfer between accounts, platforms, or sessions. 9. Record security events without recording cookie names or values, and provide a session-revocation procedure for suspected exposure. 10. Treat cookie clear/import operations as account-impacting actions that require confirmation and post-operation verification.
