Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

junhoyeo/tokscale
main @ d8ef9ac
24
Fixes
0
CVEs
HIGH
Peak severity
34.8%
Coverage
Highlights
Auth Bypass: 6 prior fixes. Scrutinize any change in this area.
packages/frontend/src/lib/auth/personalTokens.ts: most-fixed (3 issues). Treat as high-risk during review.
8 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Auth Bypass: Session parsing logic previously allowed authorization headers to bypass browser session restrictions on sensitive mutation endpoints, potentially allowing personal tokens to be used where only cookie-authenticated browser sessions are permitted.
Race Condition: Device flow polling suffered from race conditions where concurrent requests could generate multiple active tokens for a single approval because database select-then-update sequences were not locked within transactions.
Insecure File Permissions: The CLI tool stored credentials and session states in temporary and configuration files using open operations that briefly exposed sensitive contents with default permissions before restrictive chmod commands were executed, leaving them vulnerable to local concurrent reads.