Security context

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

go-mgo/mgo
v2-unstable @ 7446a03
3
Fixes
0
CVEs
HIGH
Peak severity
Highlights
Auth Bypass: 2 prior fixes. Scrutinize any change in this area.
session.go: most-fixed (2 issues). Treat as high-risk during review.
3 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: Flawed error propagation in session.go allowed Query.One(nil) calls to return successfully (nil) even when database authorization or query errors actually occurred, bypassing query-level access blocks.
Auth Bypass: Misconfigured role constant string (RoleUserAdminAny) used incorrect casing ('userAdminAnyDatabase' vs 'useradminanydatabase'), leading to failed role match validations on MongoDB servers.
Buffer Overflow: A heap-based buffer overflow occurred during Kerberos authentication on Windows due to a hardcoded copy limit (25) when manipulating the userPlusRealm string instead of dynamically computing string lengths.