T09 · Insecure Skill Coding Practices
- Location
src/lib/cookies.ts:146- Finding
Cross-Domain Forwarding of Authentication Cookies
- Content
View full analysis
= {}; for (const url of domains) { const result = await getCookies({ url, browsers: [source], timeoutMs: 30_000, ...(chromeProfile ? { chromeProfile } : {}), }); Object.assign(allCookies, toCookieMap(result.cookies)); } ``` The merged collection is subsequently serialized without domain filtering: ```ts private baseHeaders(): Record { return { "User-Agent": USER_AGENT, Cookie: cookiesToString(this.cookies), }; } ``` ### Technical Analysis The cookie extraction module retrieves cookies applicable to two distinct HTTPS origins: - `www.startupschool.org` - `account.ycombinator.com` It then merges the results into a single map that preserves only cookie names and values. Domain, path, security, expiration, and SameSite metadata are discarded. `YcClient` serializes every entry in this merged map into one `Cookie` header and sends it to `www.startupschool.org`. This behavior reproduces neither browser cookie-domain isolation nor standard cookie-jar matching. A cookie returned specifically for `account.ycombinator.com` can therefore be forwarded to `www.startupschool.org`, even if a browser would not attach that cookie to the request. Cookie-name collisions create an additional correctness issue: `Object.assign` causes cookies collected ...[truncated 1666 chars]- Remediation
View remediation
