Note Mark CVE-2026-40263
LOWSeverity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N
Network vector and no privileges required, but AC:H because timing discrimination demands repeated probing across variable network conditions; C:L reflects username-only disclosure with no credential or data impact.
Primary rating from GitHub Advisory.
CVSS VectorGitHub Advisory
Lifecycle Timeline
4DescriptionGitHub Advisory
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
AnalysisAI
Username enumeration via timing side-channel in Note Mark's login endpoint (POST /api/auth/token) allows unauthenticated remote attackers to confirm whether a given username exists in the system by measuring bcrypt-induced response time differences. Existing usernames average ~61.6ms per request while nonexistent usernames return in ~2.7ms, a gap large enough for reliable discrimination under typical network conditions. A publicly available proof-of-concept exploit exists per the GHSA advisory and SSVC assessment; however, the vulnerability is not listed in CISA KEV and carries an EPSS of 0.03% (8th percentile), indicating no observed widespread exploitation at time of analysis.
Technical ContextAI
Note Mark is a self-hosted, Go-based note-taking application (CPE: pkg:go/github.com_enchant97_note-mark_backend). The vulnerability is rooted in CWE-208 (Observable Timing Discrepancy), a class of flaw where the time taken to process a request leaks internal state to an external observer. The affected login handler queries the database for the supplied username and, only when found, invokes bcrypt.CompareHashAndPassword against the stored hash. Since bcrypt is intentionally compute-intensive (default cost factor), this conditional branch creates a ~23x timing differential between the two code paths. The absence of a dummy bcrypt operation when the user does not exist is the direct root cause. The fix (commit cf4c6f6acf70b569d80396d323b067c00d45c034) introduces a pre-computed null hash constant and always calls bcrypt.CompareHashAndPassword regardless of lookup outcome, equalizing timing behavior across both code paths.
RemediationAI
Update the Note Mark backend to the patched version by applying commit cf4c6f6acf70b569d80396d323b067c00d45c034, which resolves to Go pseudo-version 0.19.2-0.20260411145025-cf4c6f6acf70. The patch details are available at https://github.com/enchant97/note-mark/commit/cf4c6f6acf70b569d80396d323b067c00d45c034. If an immediate upgrade is not possible, a compensating control is to place the login endpoint behind a rate-limiting reverse proxy (e.g., nginx or Caddy) configured to enforce a minimum response time or fixed-delay response for authentication attempts; note this does not eliminate the timing differential but increases measurement noise and cost for an attacker. Restricting network access to the login endpoint to known IP ranges (if the deployment is internal-only) removes the network attack vector entirely. Account lockout or CAPTCHA on repeated failures provides additional friction without eliminating the underlying flaw.
Same weakness CWE-208 – Observable Timing Discrepancy
View allSame technique Information Disclosure
View allShare
External POC / Exploit Code
Leaving vuln.today
GHSA-w6m9-39cv-2fwp