Cline OAuth flow missing state/PKCE (login CSRF + code injection) #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High
packages/core/src/provider/cline/auth.tsauthorizeUrl()sets onlyclient_type,callback_url,redirect_uri. There is nostate, nononce, and no PKCEcode_challenge. The loopback callback server binds a predictable port range (48801–48811) and exchanges anyGET /auth?code=…it receives, with no state validation.Impact
fetch("http://127.0.0.1:48801/auth?code=ATTACKER_CODE", {mode:"no-cors"}). The request reaches the server regardless of CORS (CORS only blocks reading the response, not the request). Thorny exchanges the attacker's code and stores the attacker's tokens — the victim is silently signed into the attacker's Cline account, and subsequent work/keys land there.Fix
state, include it inauthorizeUrl, reject callbacks whosestatedoes not match (RFC 6749 §10.12).code_challenge/code_verifier, S256) toauthorizeUrl+exchangeCode.Found via security audit.