T05 · Unauthorized Access and Privilege Escalation
- Location
references/api-discovery.md:205- Finding
Broad Enumeration of Browser Cookies and Storage Credentials
- Content
View full analysis
{const[k,v]=x.split('=');o[k]=v;return o},{})" ``` ```bash opencli browser eval "Object.keys(localStorage).map(k=>k+' => '+localStorage.getItem(k).slice(0,50))" ``` ### Technical Analysis The discovery workflow enumerates every script-readable cookie and returns every local-storage key together with the first 50 characters of its value. It does not initially restrict access to known authentication keys such as a specific CSRF token or session-cookie name. This violates least-privilege principles because adapter discovery normally requires identifying and using only the credential associated with the selected endpoint. The output may include unrelated session identifiers, bearer tokens, personal preferences, tenant identifiers, or credentials belonging to other applications hosted under the same origin. Because these values are returned through `opencli browser eval`, they may also enter terminal output, agent context, conversation logs, or diagnostic records. ### Attack Path 1. A user opens an authenticated target site in the browser session. 2. The agent encounters an authenticated API and follows the token-discovery procedure. 3. The cookie command returns all non-HttpOnly cookies for the current document. 4. The storage command returns every local-storage key and a portion of every value. 5. Unrelated credentials become visible to the agent and may be retained in tool output or logs. 6. A malicious or compromised adapter-authoring process could reuse the exposed values outside the intended API request. ### Impact Assessment The exposed scope is limited to cookies accessible to page JavaScript and storage associated with the current origin. HttpOnly cookies are not exposed by the first ...[truncated 388 chars]- Remediation
View remediation
