T09 · Insecure Skill Coding Practices
Error
- Location
- cookies.json:1
- Finding
- Authentication Session Credentials Committed to the Project<![CDATA[ ## Vulnerability Details **File Location**: `cookies.json:1` **Vulnerability Type**: Hardcoded authentication credentials and plaintext sensitive data **Risk Level**: High ### Vulnerable Code The project contains a browser cookie export with Jianying authentication and session credentials. Sensitive values are redacted below to prevent further disclosure: ```json [ { "domain": ".xyq.jianying.com", "httpOnly": true, "name": "uid_tt_ss_pippitcn_web", "path": "/", "secure": true, "value": "[REDACTED]" }, { "domain": ".xyq.jianying.com", "httpOnly": true, "name": "ssid_ucp_v1_pippitcn_web", "path": "/", "secure": true, "value": "[REDACTED]" }, { "domain": ".jianying.com", "httpOnly": false, "name": "passport_csrf_token", "path": "/", "secure": true, "value": "[REDACTED]" }, { "domain": ".xyq.jianying.com", "httpOnly": true, "name": "session_tlb_tag_pippitcn_web", "path": "/", "secure": true, "value": "[REDACTED]" }, { "domain": ".xyq.jianying.com", "httpOnly": true, "name": "sessionid_ss_pippitcn_web", "path": "/", "secure": true, "value": "[REDACTED]" }, { "domain": ".xyq.jianying.com", "httpOnly": true, "name": "sid_ucp_v1_pippitcn_web", "path": "/", "secure": true, "value": "[REDACTED]" } ] ``` ### Technical Analysis The checked-in file contains account identifiers, session IDs, authentication-state cookies, and a CSRF token. The worker explicitly imports these values into a browser context: ```python cookies = load_and_clean_cookies() await context.add_cookies(cookies) ``` Consequently, possession of the project can provide the same browser authentication state that the automation uses. The `httpOnly` attribute only prevents browser-side JavaScript from reading a cookie; it does not protect a cookie already exposed in a file. The recorded expiration timestamps may now have elap ...[truncated 1213 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Immediately revoke all exposed sessions by signing out active sessions, rotating credentials where supported, and regenerating CSRF/session material. 2. Delete `cookies.json` from the project and purge it from all version-control history and published artifacts. 3. Add `cookies.json` and similar browser-export files to `.gitignore`. 4. Distribute only a non-secret `cookies.example.json` containing placeholders. 5. Load credentials at runtime from a user-controlled secret store or a protected path outside the project. 6. Restrict secret-file permissions to the account running the worker. 7. Add secret scanning to pre-commit hooks and CI, including rules for session cookie names used by the service. 8. Ensure logs and error responses never include cookie values. ]]>
