5.3medium
Fiber: Username Enumeration via Timing Oracle in BasicAuth Default Authorizer
- Severity
- 5.3medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.39% (higher than 34% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-g5vh-55hw-rxm8GO-2026-5886
Description
Fiber is an Express inspired web framework written in Go. Prior to 3.3.0, the default Authorizer function in the BasicAuth middleware in middleware/basicauth/config.go uses short-circuit evaluation that skips password hash comparison for non-existent usernames, enabling reliable remote username enumeration through response timing differences. This issue is fixed in version 3.3.0.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| gofiber fiber | < 3.3.0, before 3.3.0 | CVE List, NVD |
| github.com/gofiber/fiber/v3 (Go) | before 3.3.0 | GitHub Advisory Database, Go Vulnerability Database |
All scores
| GitHub_M | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
| GitHub | 5.3medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
Fiber is an Express inspired web framework written in Go. Prior to 3.3.0, the default Authorizer function in the BasicAuth middleware in middleware/basicauth/config.go uses short-circuit evaluation that skips password hash comparison for non-existent usernames, enabling reliable remote username enumeration through response timing differences. This issue is fixed in version 3.3.0.
GitHub Advisory Database
Summary
The default Authorizer function in GoFiber's BasicAuth middleware uses short-circuit evaluation that skips password hash comparison for non-existent usernames. With bcrypt-hashed passwords (the primary use case), the timing difference between a valid and invalid username is approximately 1,000,000:1 (~100ms vs ~100ns), enabling reliable remote username enumeration.
Vulnerable Code
File: middleware/basicauth/config.go, lines 126-138
if cfg.Authorizer == nil {
verifiers := make(map[string]func(string) bool, len(cfg.Users))
for u, hpw := range cfg.Users {
v, err := parseHashedPassword(hpw)
if err != nil {
panic(err)
}
verifiers[u] = v
}
cfg.Authorizer = func(user, pass string, _ fiber.Ctx) bool {
verify, ok := verifiers[user]
return ok && verify(pass) // line 137: short-circuit skips verify() if user unknown
}
}
Data Flow
- Attacker sends
Authorization: Basic <base64(candidate:wrongpass)> - BasicAuth middleware decodes credentials and calls
cfg.Authorizer(user, pass, c) - Map lookup
verifiers[user]returnsok=falsefor non-existent users - Go
&&short-circuit:false && verify(pass)returns immediately without callingverify() - For valid users,
verify(pass)executesbcrypt.CompareHashAndPassword()(line 167: ~100ms at default cost 10) - Timing difference: ~100ns (invalid user) vs ~100ms (valid user) = 1,000,000:1 ratio
Timing comparison by hash type:
| Hash Type | Valid User | Invalid User | Ratio |
|---|---|---|---|
| bcrypt ($2) | ~100 ms | ~100 ns | 1,000,000:1 |
| SHA-512 | ~1-5 us | ~100 ns | 10-50:1 |
| SHA-256 | ~1-5 us | ~100 ns | 10-50:1 |
Impact
- Username enumeration: Attacker reliably determines which usernames exist by measuring response latency
- Targeted brute force: After enumerating valid usernames, password brute force is focused only on real accounts
- Account discovery: In applications where usernames are sensitive (internal tools, admin panels), leaking their existence is itself a security issue
Notes
- Password hash comparisons themselves are timing-safe:
subtle.ConstantTimeCompareis used correctly for SHA-256 (line 185), SHA-512 (line 176), and bcrypt uses its own constant-time comparison - The fix is to always execute a dummy hash comparison for unknown users:
bcrypt.CompareHashAndPassword(dummyHash, []byte(pass))and discard the result - This pattern matches CVE-2023-36456 (Authentik timing oracle) and similar findings in other auth libraries
Go Vulnerability Database
GoFiber Vulnerable to Username Enumeration via Timing Oracle in BasicAuth Default Authorizer in github.com/gofiber/fiber
NVD (es)
Fiber es un framework web inspirado en Express escrito en Go. Antes de la versión 3.3.0, la función Authorizer predeterminada en el middleware BasicAuth en middleware/basicauth/config.go utiliza evaluación de cortocircuito que omite la comparación del hash de la contraseña para nombres de usuario inexistentes, lo que permite una enumeración remota fiable de nombres de usuario a través de diferencias en el tiempo de respuesta. Este problema está solucionado en la versión 3.3.0.
References
| https://github.com/gofiber/fiber/security/advisories/GHSA-g5vh-55hw-rxm8 | advisory, exploit, vendor-advisory, web | |
| https://github.com/gofiber/fiber/pull/4245 | fix, issue-tracking, patch | |
| https://github.com/gofiber/fiber/commit/c7ac00edd19f9669b1aebbec6e229658baaa059e | patch | |
| https://github.com/gofiber/fiber/releases/tag/v3.3.0 | release-notes | |
| https://github.com/gofiber/fiber | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44332 changed 2026-07-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-g5vh-55hw-rxm8 changed 2026-07-24 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2026-5886 changed 2026-07-24 | CC-BY-4.0 |
| NVD | CVE-2026-44332 changed 2026-10-25 | Public domain |