VYPR
Critical severityNVD Advisory· Published Feb 9, 2026· Updated Feb 10, 2026

Fiber insecurely fallsback in utils.UUIDv4() / utils.UUID() — predictable / zero‑UUID on crypto/rand failure

CVE-2025-66630

Description

Fiber is an Express inspired web framework written in Go. Before 2.52.11, on Go versions prior to 1.24, the underlying crypto/rand implementation can return an error if secure randomness cannot be obtained. Because no error is returned by the Fiber v2 UUID functions, application code may unknowingly rely on predictable, repeated, or low-entropy identifiers in security-critical pathways. This is especially impactful because many Fiber v2 middleware components (session middleware, CSRF, rate limiting, request-ID generation, etc.) default to using utils.UUIDv4(). This vulnerability is fixed in 2.52.11.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
github.com/gofiber/fiber/v2Go
< 2.52.112.52.11

Affected products

1

Patches

1
eb874b6f6c58

Merge commit from fork

https://github.com/gofiber/fiberJason McNeilDec 10, 2025via ghsa
1 file changed · +3 5
  • utils/common.go+3 5 modified
    @@ -9,6 +9,7 @@ import (
     	"crypto/rand"
     	"encoding/binary"
     	"encoding/hex"
    +	"fmt"
     	"math"
     	"net"
     	"os"
    @@ -47,13 +48,10 @@ func UUID() string {
     	// Setup seed & counter once
     	uuidSetup.Do(func() {
     		if _, err := rand.Read(uuidSeed[:]); err != nil {
    -			return
    +			panic(fmt.Sprintf("utils: failed to seed UUID generator: %v", err))
     		}
     		uuidCounter = binary.LittleEndian.Uint64(uuidSeed[:8])
     	})
    -	if atomic.LoadUint64(&uuidCounter) <= 0 {
    -		return emptyUUID
    -	}
     	// first 8 bytes differ, taking a slice of the first 16 bytes
     	x := atomic.AddUint64(&uuidCounter, 1)
     	uuid := uuidSeed
    @@ -84,7 +82,7 @@ func UUID() string {
     func UUIDv4() string {
     	token, err := googleuuid.NewRandom()
     	if err != nil {
    -		return UUID()
    +		panic(fmt.Sprintf("utils: failed to generate secure UUID: %v", err))
     	}
     	return token.String()
     }
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

5

News mentions

0

No linked articles in our index yet.