
Cloud Vulnerability DB
A community-led vulnerabilities database
CSRF tokens in github.com/dinever/golf before v0.3.0 are generated using math/rand, which is not a cryptographically secure random number generator, allowing an attacker to predict values and bypass CSRF protections with relatively few requests (NVD, Go Packages).
The vulnerability exists in the randomBytes function in xsrf.go which uses math.rand seeded with time.Now().UTC().UnixNano() to generate CSRF tokens. This implementation is unsafe as it uses a predictable seed value with a non-cryptographic random number generator, making the generated tokens predictable (GitHub Issue).
An attacker could predict CSRF token values due to the use of a non-cryptographic random number generator (math/rand) and predictable seed values. This allows bypassing CSRF protection mechanisms with relatively few requests, potentially leading to unauthorized actions being performed on behalf of authenticated users (Go Packages).
The issue was fixed in version v0.3.0 by replacing math/rand with crypto/rand for CSRF token generation. The fix implements a cryptographically secure random number generator to ensure unpredictable token values (GitHub PR).
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."