T09 · Insecure Skill Coding Practices
Warning
- Location
- REFERENCE.md:360
- Finding
- Persistent Authenticated Browser Profile Exposed Through an Unprotected Debugging Interface## Vulnerability Details **File Location**: `REFERENCE.md:16`, `REFERENCE.md:360-378`, `REFERENCE.md:384-393`, `REFERENCE.md:458-471`; `EXAMPLES.md:144` **Vulnerability Type**: Persistent session exposure and insecure browser-debugging configuration **Risk Level**: Medium ### Evidence `REFERENCE.md:16`: ```markdown - **Chrome Profile**: `.chrome-profile/` - Persistent browser profile directory ``` `REFERENCE.md:360-378`: ```markdown ### Chrome Launch Arguments Chrome is launched by `src/cli.ts` with: ```bash --remote-debugging-port=9222 --user-data-dir=.chrome-profile --window-position=-9999,-9999 --window-size=1280,720 ``` **Arguments**: - `--remote-debugging-port`: Enables CDP on port 9222 - `--user-data-dir`: Persistent profile directory for session/cookie persistence - `--window-position`: Launches minimized off-screen - `--window-size`: Default window size ``` `REFERENCE.md:384-393`: ```markdown ```typescript await client.send("Browser.setDownloadBehavior", { behavior: "allow", downloadPath: "./agent/downloads", eventsEnabled: true, }) ``` **Behavior**: - Downloads start automatically (no dialog) - Files saved to `./agent/downloads/` - Download events can be monitored via CDP ``` `REFERENCE.md:458-471`: ```markdown ### Credential Handling - Browser uses persistent profile (`.chrome-profile/`) - Saved passwords and cookies persist between sessions - Consider using isolated profiles for sensitive operations ### Download Safety - Downloads automatically saved to `./agent/downloads/` - No file type restrictions enforced - Verify downloaded file integrity before use ### Network Access - Browser has full network access - Respects system proxy settings - Can access localhost and internal networks ``` `EXAMPLES.md:144`: ```markdown **Note**: This example uses Chrome's user profile (`.chrome-profile/`) which may preserve session ...[truncated 3270 chars]
- Remediation
- ## Remediation Suggestions 1. **Use ephemeral profiles by default** - Create a unique temporary Chrome profile for every task. - Delete the profile during cleanup, including after failures and timeouts. - Require explicit user consent before retaining cookies or login state. 2. **Protect the CDP endpoint** - Bind the debugging service explicitly to `127.0.0.1` or an equivalent local-only interface. - Use a randomized, per-run port rather than fixed port `9222`. - Do not expose CDP through externally reachable interfaces, containers, or forwarded ports. - Where supported, place the endpoint behind an authenticated local transport or use a private pipe instead of a TCP listener. 3. **Isolate sensitive sessions** - Never reuse a user's normal Chrome profile. - Separate profiles by user, task, and trust domain. - Disable password storage and unnecessary browser synchronization in automation profiles. - Clear cookies, local storage, service workers, caches, and authentication tokens when a task finishes. 4. **Restrict browser network access** - Block localhost, link-local, private-address, and internal-network destinations unless explicitly required. - Apply destination allowlists for narrowly scoped automation tasks. - Prevent redirects from approved public destinations to restricted internal addresses. 5. **Harden download handling** - Require confirmation before downloads. - Apply file-type, size, and destination restrictions. - Store downloads in a unique non-executable temporary directory. - Scan downloaded files and never execute them automatically. 6. **Provide verifiable implementation controls** - Include the referenced source code, package manifest, and lockfile in the artifact. - Add automated tests confirming that CDP is loopback-only, profiles are isolated, and cleanup removes persistent session data. - Document the exact runtime bind ad ...[truncated 80 chars]
