T09 · Insecure Skill Coding Practices
Warning
- Location
- SKILL.md:106
- Finding
- Plaintext Persistence of Browser Authentication State## Vulnerability Details **File Location**: `SKILL.md`, lines 106 and 161 **Vulnerability Type**: Plaintext storage of sensitive browser authentication data **Risk Level**: Medium ### Vulnerable Code ```bash agent-browser state save auth.json # Save cookies/storage ``` ```markdown 4. **Save auth state** - Skip login flows with `state save/load` ``` ### Technical Analysis The skill recommends saving browser cookies and storage to a predictable local file named `auth.json`. Browser state may contain reusable session cookies, access tokens, refresh tokens, and other authentication material. The instructions do not require restrictive file permissions, an isolated secret directory, encryption, automatic cleanup, or exclusion from version control. Consequently, the generated file may be exposed to other local users, repository commits, backups, build artifacts, or unrelated file-collection processes. ### Attack Path 1. An agent authenticates to a website through the browser. 2. The agent follows the documented recommendation and runs `agent-browser state save auth.json`. 3. Active cookies and browser storage are written to the predictable plaintext file. 4. The file remains on disk, is read by another local process or user, or is accidentally committed or uploaded. 5. An attacker extracts or loads the stored authentication state. 6. If the credentials remain valid and are not sufficiently device-bound, the attacker impersonates the victim and accesses the corresponding account. ### Impact Assessment Successful exploitation can disclose active browser-session credentials and permit unauthorized access with the victim's existing web-account privileges. The scope depends on the authenticated sites represented in the saved state and may include access to private account data or actions available to that user. This issue does not itself grant operating-system privilege escalation. Exploitation requires access to the generated state file through local re ...[truncated 81 chars]
- Remediation
- ## Remediation Suggestions - Save authentication state only when strictly required. - Clearly warn users and agents that saved state must be treated as credential material. - Store state in a dedicated secret directory outside the repository rather than using a predictable project-relative filename. - Create the destination with owner-only permissions and ensure the state file is readable only by the account running the browser. - Add all browser-state filenames and directories to `.gitignore` and equivalent artifact-exclusion rules. - Prefer an operating-system-backed credential store or encryption at rest where supported. - Use a temporary, uniquely named path when persistence across runs is unnecessary. - Delete the state file immediately after its intended use and revoke affected sessions if exposure is suspected. - Avoid collecting or retaining cookies and storage unrelated to the required workflow.
