CVE-2026-40263: Note Mark: Username Enumeration via Login Endpoint Timing Side-Channel
Summary A timing side-channel in the login endpoint allows unauthenticated attackers to determine whether a username exists by measuring response time differences. Requests for valid usernames take noticeably longer because the server performs bcrypt password verification, while requests for nonexistent usernames return much faster.
Published Apr 13, 2026 · Updated Apr 24, 2026
Affected packages
github.com/enchant97/note-mark/backend
- Ecosystem
- Go
- Affected
- < 0.19.2-0.20260411145025-cf4c6f6acf70
- Fixed in
- 0.19.2-0.20260411145025-cf4c6f6acf70
- Check
go list -m github.com/enchant97/note-mark/backend
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
A timing side-channel in the login endpoint allows unauthenticated attackers to determine whether a username exists by measuring response time differences. Requests for valid usernames take noticeably longer because the server performs bcrypt password verification, while requests for nonexistent usernames return much faster. This enables reliable remote username enumeration and increases the risk of targeted credential attacks.
Details
The issue affects the login endpoint:
POST /api/auth/token
The root cause is that authentication processing takes different code paths depending on whether the supplied username exists. When the username is found, the server performs bcrypt.CompareHashAndPassword, which adds substantial latency. When the username does not exist, the server returns immediately without performing an equivalent bcrypt operation.
Vulnerable flow:
user, err := db.Where("username = ?", username).First(&user)
if err != nil {
return ErrUnauthorized
}
err = bcrypt.CompareHashAndPassword(user.PasswordHash, []byte(password))This creates a measurable timing discrepancy between:
- existing username + wrong password requests, which incur bcrypt cost
- nonexistent username + any password requests, which avoid bcrypt entirely
Because no constant-time equalization is performed, the endpoint leaks account existence through timing behavior.
The measurements provided show a large and consistent gap between the two cases across repeated trials, making the difference distinguishable without requiring especially high request volume. In the supplied test results:
- existing user requests averaged about
0.0616s - nonexistent user requests averaged about
0.0027s
That gap is large enough to support reliable username enumeration under typical testing conditions.
PoC
The issue can be reproduced by sending repeated authentication attempts to the login endpoint using the same invalid password while alternating between a known valid username and a nonexistent username, then comparing average response times. Valid usernames consistently take longer because bcrypt verification is performed.
Impact
- Type: Timing side-channel / username enumeration
- Who is impacted: Any deployment exposing the affected login endpoint
- Security impact: Unauthenticated attackers can confirm valid usernames one at a time, improving the effectiveness of credential stuffing, password spraying, phishing, and other targeted account attacks
- Attack preconditions: None beyond network access to the login endpoint
- Confidentiality impact: Low to moderate, depending on the sensitivity of account existence in the target environment
Credited to QiaoNPC, Across-Verticals-Malaysia, enchant97.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More Go vulnerabilities
All Go entriesCVE-2026-50553
Note Mark: Path traversal via unsanitized book/note slug in migrate export (sibling of GHSA-g49p)
high8.6Jul 9, 2026CVE-2026-50554
Note Mark: Unauthenticated disclosure of soft-deleted note metadata via deleted=true on public books
medium5.3Jul 9, 2026CVE-2026-44522
Note Mark: Arbitrary File Write via Path Traversal in Asset Names Leads to Remote Code Execution
high8.6May 7, 2026CVE-2026-44523
Note Mark has a JWT Secret Weakness that allows Full Account Takeover via Token Forgery
critical10.0May 7, 2026CVE-2026-41571
Note Mark: OIDC-registered users authenticated by submitting password "null"
critical9.4Apr 25, 2026CVE-2026-41572
Note Mark: Unauthenticated read of notes and assets in soft-deleted public books
medium5.3Apr 25, 2026
