Low severity3.7NVD Advisory· Published Apr 17, 2026· Updated Apr 17, 2026
CVE-2026-40263
CVE-2026-40263
Description
Note Mark is an open-source note-taking application. In versions 0.19.1 and prior, the login endpoint performs bcrypt password verification only when the supplied username exists, returning immediately for nonexistent usernames. This timing discrepancy allows unauthenticated attackers to enumerate valid usernames by measuring response times, enabling targeted credential attacks. This issue has been fixed in version 0.19.2.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
github.com/enchant97/note-mark/backendGo | < 0.19.2-0.20260411145025-cf4c6f6acf70 | 0.19.2-0.20260411145025-cf4c6f6acf70 |
Affected products
1Patches
1cf4c6f6acf70(backend) prevent CWE-208 for internal login
2 files changed · +9 −2
backend/db/models.go+8 −2 modified@@ -33,6 +33,8 @@ type User struct { OidcRegistrations []OidcUser `gorm:"foreignKey:UserID" json:"oidcRegistrations,omitempty"` } +var nullPasswordHash, _ = bcrypt.GenerateFromPassword([]byte("null"), bcrypt.DefaultCost) + func (u *User) SetPassword(newPlainPassword string) { hashedPw, err := bcrypt.GenerateFromPassword([]byte(newPlainPassword), bcrypt.DefaultCost) if err != nil { @@ -42,10 +44,14 @@ func (u *User) SetPassword(newPlainPassword string) { } func (u *User) IsPasswordMatch(plainPassword string) bool { + var current []byte if len(u.Password) == 0 { - return false + // prevent CWE-208 + current = nullPasswordHash + } else { + current = u.Password } - if err := bcrypt.CompareHashAndPassword(u.Password, []byte(plainPassword)); err == nil { + if err := bcrypt.CompareHashAndPassword(current, []byte(plainPassword)); err == nil { return true } return false
backend/services/auth.go+1 −0 modified@@ -29,6 +29,7 @@ func (s AuthService) GetAccessToken( if err := db.DB. First(&user, "username = ?", username). Select("id", "password").Error; err != nil { + user.IsPasswordMatch(password) // prevent CWE-208 return core.AccessToken{}, InvalidCredentialsError }
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
4News mentions
0No linked articles in our index yet.