{"id":"CVE-2026-44332","aliases":["CVE-2026-44332","GHSA-g5vh-55hw-rxm8","GO-2026-5886"],"related":[],"kind":"vulnerability","state":"published","title":"Fiber: Username Enumeration via Timing Oracle in BasicAuth Default Authorizer","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe 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.\n\n## Vulnerable Code\n\n**File:** `middleware/basicauth/config.go`, lines 126-138\n\n```go\nif cfg.Authorizer == nil {\n    verifiers := make(map[string]func(string) bool, len(cfg.Users))\n    for u, hpw := range cfg.Users {\n        v, err := parseHashedPassword(hpw)\n        if err != nil {\n            panic(err)\n        }\n        verifiers[u] = v\n    }\n    cfg.Authorizer = func(user, pass string, _ fiber.Ctx) bool {\n        verify, ok := verifiers[user]\n        return ok && verify(pass)   // line 137: short-circuit skips verify() if user unknown\n    }\n}\n```\n\n## Data Flow\n\n1. Attacker sends `Authorization: Basic <base64(candidate:wrongpass)>`\n2. BasicAuth middleware decodes credentials and calls `cfg.Authorizer(user, pass, c)`\n3. Map lookup `verifiers[user]` returns `ok=false` for non-existent users\n4. Go `&&` short-circuit: `false && verify(pass)` returns immediately without calling `verify()`\n5. For valid users, `verify(pass)` executes `bcrypt.CompareHashAndPassword()` (line 167: ~100ms at default cost 10)\n6. Timing difference: ~100ns (invalid user) vs ~100ms (valid user) = 1,000,000:1 ratio\n\n**Timing comparison by hash type:**\n\n| Hash Type | Valid User | Invalid User | Ratio |\n|-----------|-----------|--------------|-------|\n| bcrypt ($2) | ~100 ms | ~100 ns | 1,000,000:1 |\n| SHA-512 | ~1-5 us | ~100 ns | 10-50:1 |\n| SHA-256 | ~1-5 us | ~100 ns | 10-50:1 |\n\n## Impact\n\n- **Username enumeration:** Attacker reliably determines which usernames exist by measuring response latency\n- **Targeted brute force:** After enumerating valid usernames, password brute force is focused only on real accounts\n- **Account discovery:** In applications where usernames are sensitive (internal tools, admin panels), leaking their existence is itself a security issue\n\n## Notes\n\n- Password hash comparisons themselves are timing-safe: `subtle.ConstantTimeCompare` is used correctly for SHA-256 (line 185), SHA-512 (line 176), and bcrypt uses its own constant-time comparison\n- The fix is to always execute a dummy hash comparison for unknown users: `bcrypt.CompareHashAndPassword(dummyHash, []byte(pass))` and discard the result\n- This pattern matches CVE-2023-36456 (Authentik timing oracle) and similar findings in other auth libraries","format":"markdown","source":"ghsa"},{"lang":"en","text":"GoFiber Vulnerable to Username Enumeration via Timing Oracle in BasicAuth Default Authorizer in github.com/gofiber/fiber","format":"markdown","source":"go"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-07-02T13:46:25.000Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-203"],"affected":[{"ranges":[{"version":"< 3.3.0","status":"affected"}],"vendor":"gofiber","product":"fiber","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.3.0"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v3","purl":"pkg:golang/github.com/gofiber/fiber/v3","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"3.3.0"}],"ecosystem":"Go","package":"github.com/gofiber/fiber/v3","purl":"pkg:golang/github.com/gofiber/fiber/v3","source":"go"},{"ranges":[{"status":"affected","fixed":"3.3.0"}],"vendor":"gofiber","product":"fiber","cpe":"cpe:2.3:a:gofiber:fiber:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/gofiber/fiber/security/advisories/GHSA-g5vh-55hw-rxm8","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/gofiber/fiber/pull/4245","tags":["fix","issue-tracking","patch","x-refsource-misc"],"sources":["cvelist","go","nvd"]},{"url":"https://github.com/gofiber/fiber/commit/c7ac00edd19f9669b1aebbec6e229658baaa059e","tags":["patch","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gofiber/fiber/releases/tag/v3.3.0","tags":["release-notes","x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/gofiber/fiber","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-09T14:33:24.172Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-44332","url":"https://www.cve.org/CVERecord?id=CVE-2026-44332","licence":"CVE Terms of Use","modified":"2026-07-09T14:33:29.004Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-g5vh-55hw-rxm8","url":"https://github.com/advisories/GHSA-g5vh-55hw-rxm8","licence":"CC-BY-4.0","modified":"2026-07-24T19:11:49.453Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5886","url":"https://pkg.go.dev/vuln/GO-2026-5886","licence":"CC-BY-4.0","modified":"2026-07-24T19:00:26.870Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-44332","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-44332","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"}],"updatedAt":"2026-11-25T22:59:27.411Z","epss":{"score":0.00387,"percentile":0.34867,"date":"2026-12-01T12:00:22.000Z"}}