Security context

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

qvest-digital/loginsrv
master @ eb0ac26
7
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Denial of Service: 5 prior fixes. Scrutinize any change in this area.
oauth2: most-fixed (3 issues). Treat as high-risk during review.
2 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.

Insecure Randomness: The generation of OAuth2 state parameters originally relied on a weak pseudorandom generator (math/rand) combined with low byte entropy, allowing attackers to predict state values and execute session fixation or CSRF attacks. Subsequent fixes swapped the generator for a cryptographically secure alternative and doubled the state token byte length.
Denial of Service: Concurrent access to user records and authentication hashes in the htpasswd file parser caused map write race conditions and subsequent program crashes. This required replacing package-level globals with fine-grained read/write mutexes bound directly to the authentication struct instances.
Denial of Service: A lack of validation on API responses from upstream OAuth providers caused nil pointer dereferences. Specifically, assuming a user profile always contains at least one email address (gu.Emails[0]) caused panics and crashes when encountering accounts without registered email addresses.