CVE-2026-44332: Fiber: Username Enumeration via Timing Oracle in BasicAuth Default Authorizer

Published Jul 2, 2026
·
Updated

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

go 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

1. Attacker sends Authorization: Basic <base64(candidate:wrongpass)> 2. BasicAuth middleware decodes credentials and calls cfg.Authorizer(user, pass, c) 3. Map lookup verifiers[user] returns ok=false for non-existent users 4. Go && short-circuit: false && verify(pass) returns immediately without calling verify() 5. For valid users, verify(pass) executes bcrypt.CompareHashAndPassword() (line 167: ~100ms at default cost 10) 6. 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.ConstantTimeCompare is 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

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
go/github.com/gofiber/fiber/v3<=3.2.0
3.3.0
gofiber Fiber Go<3.3.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/gofiber/fiber/v3 to a version that resolves this vulnerability.

    Fixed in 3.3.0
  2. Upgrade

    Upgrade GoFiber BasicAuth middleware to a version that resolves this vulnerability.

    Fixed in 3.3.0

Event History

Jul 2, 2026
Advisory Published
via GitHub·01:46 PM
Data Sourced
via GitHub·01:46 PM
DescriptionSeverityWeaknessAffected Software
Jul 8, 2026
CVE Published
via MITRE·07:32 PM
Data Sourced
via MITRE·07:32 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·08:16 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-44332?

The severity of CVE-2026-44332 is rated as medium with a score of 5.3.

2

How do I fix CVE-2026-44332?

To fix CVE-2026-44332, ensure that your application uses a secure password comparison method that avoids short-circuit evaluation for non-existent usernames.

3

What impact does CVE-2026-44332 have on security?

CVE-2026-44332 allows attackers to infer valid usernames based on the timing difference in password hashing, potentially leading to user enumeration attacks.

4

What software is affected by CVE-2026-44332?

CVE-2026-44332 affects the GoFiber framework, specifically the BasicAuth middleware in versions of go/github.com/gofiber/fiber/v3.

5

When was CVE-2026-44332 published?

CVE-2026-44332 was published on July 2, 2026.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203