Summary
Critical security vulnerabilities exist in both the UUIDv4() and UUID() functions of the github.com/gofiber/utils package. When the system's cryptographic random number generator (crypto/rand) fails, both functions silently fall back to returning predictable UUID values, including the zero UUID "00000000-0000-0000-0000-000000000000". This compromises the security of all Fiber applications using these functions for security-critical operations.
Both functions are vulnerable to the same root cause (crypto/rand failure):
UUIDv4(): Indirect vulnerability through uuid.NewRandom() → crypto/rand.Read() → fallback to UUID()
UUID(): Direct vulnerability through crypto/rand.Read(uuidSeed[:]) → silent zero UUID return
Vulnerability Details
Affected Functions
- Package:
github.com/gofiber/utils
- Functions:
UUIDv4() and UUID()
- Return Type:
string (both functions)
- Locations:
common.go:93-99 (UUIDv4), common.go:60-89 (UUID)
Technical Description
The vulnerability occurs through two related but distinct failure paths, both ultimately caused by crypto/rand.Read() failures:
Primary Path: UUIDv4() Vulnerability
UUIDv4() calls google/uuid.NewRandom() which internally uses crypto/rand.Read()
- If
uuid.NewRandom() fails due to entropy exhaustion, UUIDv4() falls back to the internal UUID() function