T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/zhipu_api.js:101- Finding
Unscoped Browser Cookie Collection Through Chrome DevTools
- Content
View full analysis
c.domain.includes('z.ai') || c.domain.includes('bigmodel.cn') || c.domain.includes('chatglm') ); ``` ### Technical Analysis `Network.getCookies()` is invoked without a URL allowlist. Consequently, the process retrieves every cookie visible to the connected Chrome DevTools Protocol target before filtering the results locally. This breaks the principle of least privilege because image generation only requires cookies associated with explicitly trusted Zhipu service domains. The filtering logic is also based on substring matching rather than exact domain or validated subdomain matching. A domain containing one of the selected strings in an unrelated position could therefore be treated as trusted. Although only filtered cookies are subsequently persisted, all cookies returned by Chrome are temporarily exposed within the Node.js process. Any process instrumentation, malicious modification, debugging hook, crash dump, or compromise affecting this process could expose unrelated authenticated browser sessions. ### Attack Path 1. The user runs the Skill while Chrome exposes a DevTools endpoint on port `18800`. 2. The Skill connects to the endpoint and requests cookies without specifying target URLs. 3. Chrome returns all cookies available to the connected DevTools target. 4. The complete cookie collection enters the Skill process before local filtering occurs. 5. An attacker who can instrument or compromise that process can extract unrelated session cookies. 6. Broad substring matching may ad ...[truncated 578 chars]- Remediation
View remediation
