{"id":"CVE-2026-40263","aliases":["CVE-2026-40263","GHSA-w6m9-39cv-2fwp","GO-2026-5696"],"related":[],"kind":"vulnerability","state":"published","title":"Note Mark: Username Enumeration via Login Endpoint Timing Side-Channel","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\nA 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.\n\n### Details\nThe issue affects the login endpoint:\n\n- `POST /api/auth/token`\n\nThe 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.\n\nVulnerable flow:\n\n```go\nuser, err := db.Where(\"username = ?\", username).First(&user)\nif err != nil {\n    return ErrUnauthorized\n}\nerr = bcrypt.CompareHashAndPassword(user.PasswordHash, []byte(password))\n```\n\nThis creates a measurable timing discrepancy between:\n- **existing username + wrong password** requests, which incur bcrypt cost\n- **nonexistent username + any password** requests, which avoid bcrypt entirely\n\nBecause no constant-time equalization is performed, the endpoint leaks account existence through timing behavior.\n\nThe 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:\n- existing user requests averaged about `0.0616s`\n- nonexistent user requests averaged about `0.0027s`\n\nThat gap is large enough to support reliable username enumeration under typical testing conditions.\n\n### PoC\nThe 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.\n\n### Impact\n- **Type:** Timing side-channel / username enumeration\n- **Who is impacted:** Any deployment exposing the affected login endpoint\n- **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\n- **Attack preconditions:** None beyond network access to the login endpoint\n- **Confidentiality impact:** Low to moderate, depending on the sensitivity of account existence in the target environment","format":"markdown","source":"ghsa"},{"lang":"en","text":"Note Mark: Username Enumeration via Login Endpoint Timing Side-Channel in github.com/enchant97/note-mark/backend.\n\nNOTE: The source advisory for this report contains additional versions that could not be automatically mapped to standard Go module versions.\n\n(If this is causing false-positive reports from vulnerability scanners, please suggest an edit to the report.)\n\nThe additional affected modules and versions are: github.com/enchant97/note-mark/backend before v0.19.2-0.20260411145025-cf4c6f6acf70.","format":"markdown","source":"go"},{"lang":"es","text":"Note Mark es una aplicación de código abierto para tomar notas. En las versiones 0.19.1 y anteriores, el endpoint de inicio de sesión realiza la verificación de contraseña bcrypt solo cuando el nombre de usuario proporcionado existe, devolviendo inmediatamente para nombres de usuario inexistentes. Esta discrepancia de tiempo permite a atacantes no autenticados enumerar nombres de usuario válidos midiendo los tiempos de respuesta, lo que permite ataques de credenciales dirigidos. Este problema ha sido solucionado en la versión 0.19.2.","source":"nvd"}],"published":"2026-04-13T19:31:50.000Z","modified":"2026-10-26T21:10:00.170Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N","score":3.7,"rating":"LOW"}],"cwes":["CWE-208"],"affected":[{"ranges":[{"version":"< 0.19.2","status":"affected"}],"vendor":"enchant97","product":"note-mark","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.19.2-0.20260411145025-cf4c6f6acf70"}],"ecosystem":"Go","package":"github.com/enchant97/note-mark/backend","purl":"pkg:golang/github.com/enchant97/note-mark/backend","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/enchant97/note-mark/backend","purl":"pkg:golang/github.com/enchant97/note-mark/backend","source":"go"}],"references":[{"url":"https://github.com/enchant97/note-mark/security/advisories/GHSA-w6m9-39cv-2fwp","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/enchant97/note-mark/commit/cf4c6f6acf70b569d80396d323b067c00d45c034","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40263","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/enchant97/note-mark","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2026-04-17T12:23:37.345Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40263","url":"https://www.cve.org/CVERecord?id=CVE-2026-40263","licence":"CVE Terms of Use","modified":"2026-04-17T12:23:42.042Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w6m9-39cv-2fwp","url":"https://github.com/advisories/GHSA-w6m9-39cv-2fwp","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:42.943Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5696","url":"https://pkg.go.dev/vuln/GO-2026-5696","licence":"CC-BY-4.0","modified":"2026-06-25T23:01:28.026Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40263","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40263","licence":"Public domain","modified":"2026-10-26T21:10:00.170Z"}],"updatedAt":"2026-11-25T22:59:18.926Z","epss":{"score":0.00263,"percentile":0.19335,"date":"2026-12-02T12:00:21.000Z"}}