Security context

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

quantumnous/new-api
main @ b191f47
80
Fixes
0
CVEs
CRITICAL
Peak severity
28.9%
Coverage
Highlights
Auth Bypass: 29 prior fixes. Scrutinize any change in this area.
middleware/auth.go: most-fixed (14 issues). Treat as high-risk during review.
38 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: A recurring failure pattern in TokenAuth and session helpers incorrectly mapped token identifiers (using token.Id instead of token.UserId), lacked status verification for deactivated users, and missed boundary checks for unlisted paths, allowing complete session hijacking and billing bypasses.
SSRF: Unvalidated outbound requests in video proxies and model sync interfaces allowed connections to local networks. The protective filters required multiple iterations to correctly address loopback, private ranges, DNS redirects, and self-proxying.
Denial of Service: Streaming endpoints and request decompression handlers lacked adequate limits, write deadlines, and goroutine cleanup controls, leaving the system highly susceptible to memory exhaustion and goroutine leaks during relay operations.