{"id":"CVE-2026-40265","aliases":["CVE-2026-40265","GHSA-p5w6-75f9-cc2p","GO-2026-5530"],"related":[],"kind":"vulnerability","state":"published","title":"Note Mark has Broken Access Control on Asset Download","summary":"Note Mark is an open-source note-taking application. In versions 0.19.1 and prior, the asset download endpoint at /api/notes/{noteID}/assets/{assetID} is registered without authentication middleware, and the backend query does not verify ownership or book visibility. An unauthenticated user who knows a valid note ID and asset ID can retrieve the full contents of private note assets without authentication, regardless of whether the associated book is public or private. 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 asset download endpoint at /api/notes/{noteID}/assets/{assetID} is registered without authentication middleware, and the backend query does not verify ownership or book visibility. An unauthenticated user who knows a valid note ID and asset ID can retrieve the full contents of private note assets without authentication, regardless of whether the associated book is public or private. This issue has been fixed in version 0.19.2.","source":"cvelist"},{"lang":"en","text":"### Summary\nA broken access control vulnerability allows unauthenticated users to retrieve note assets directly from the asset download endpoint when they know both the note UUID and asset UUID. This exposes the full contents of private note assets without authentication, even when the associated book is not public.\n\n### Details\nThe issue is caused by the asset download route being registered without authentication middleware.\n\nRelevant route registration:\n- `handlers/assets.go`, line 40\n\n```go\nhuma.Get(api, \"/api/notes/{noteID}/assets/{assetID}\", h.GetNoteAssetContentByID)\n```\n\nBy contrast, other asset operations correctly apply authentication middleware. For example:\n\n```go\nhuma.Delete(api, \"/api/notes/{noteID}/assets/{assetID}\", h.DeleteNoteAsset,\n    huma.WithMiddleware(h.authMiddleware.AuthRequiredMiddleware))\n```\n\nThe backend service for asset retrieval also does not enforce ownership or visibility checks. According to the provided code references, the lookup only queries the asset table by asset ID and note ID:\n\n```sql\nSELECT * FROM note_assets WHERE id = ? AND note_id = ?\n```\n\nBecause the retrieval path does not join against the related `notes` or `books` records, it does not verify:\n- whether the requester owns the parent book\n- whether the parent book is public or private\n- whether the related note has been deleted\n\nAs a result, possession of a valid `noteID` and `assetID` is sufficient to retrieve the asset binary, regardless of whether the note belongs to a private book.\n\nThe exploitability is constrained by identifier knowledge. Both `noteID` and `assetID` are UUIDv4 values, so blind guessing is impractical. However, the endpoint remains vulnerable whenever those identifiers are disclosed through another channel, such as leaked links, browser history, proxy logs, shared URLs, or other application behaviors that expose internal asset references.\n\n### PoC\nThe issue can be reproduced by creating a private note with an attached asset, then requesting the asset download endpoint without authentication using the valid `noteID` and `assetID`. The server returns the asset content even though the associated note is private.\n\n### Impact\n- **Type:** Broken access control / unauthenticated information disclosure\n- **Who is impacted:** Any deployment exposing the affected asset download endpoint\n- **Security impact:** Full binary contents of private note assets can be disclosed to unauthenticated users who know the required identifiers\n- **Attack preconditions:** The attacker must know both the target `noteID` and `assetID`; no authentication is required\n- **Attack complexity:** High, because successful exploitation depends on prior disclosure of both UUIDs rather than feasible online guessing","format":"markdown","source":"ghsa"},{"lang":"en","text":"Note Mark has Broken Access Control on Asset Download in github.com/enchant97/note-mark/backend","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 descarga de activos en /api/notes/{noteID}/assets/{assetID} está registrado sin middleware de autenticación, y la consulta del backend no verifica la propiedad o la visibilidad del libro. Un usuario no autenticado que conoce un ID de nota y un ID de activo válidos puede recuperar el contenido completo de activos de notas privadas sin autenticación, independientemente de si el libro asociado es público o privado. Este problema ha sido solucionado en la versión 0.19.2.","source":"nvd"}],"published":"2026-04-13T19:31:57.000Z","modified":"2026-10-26T22:10:00.163Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N","score":5.9,"rating":"MEDIUM"}],"cwes":["CWE-862"],"affected":[{"ranges":[{"version":"< 0.19.2","status":"affected"}],"vendor":"enchant97","product":"note-mark","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260411145023-6593898855ad"}],"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","fixed":"0.0.0-20260411145023-6593898855ad"}],"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-p5w6-75f9-cc2p","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/enchant97/note-mark/commit/6593898855add151eb9965d96998b05e14c62026","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/enchant97/note-mark/releases/tag/v0.19.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40265","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-17T18:40:35.700Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-40265","url":"https://www.cve.org/CVERecord?id=CVE-2026-40265","licence":"CVE Terms of Use","modified":"2026-04-17T18:40:45.157Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-p5w6-75f9-cc2p","url":"https://github.com/advisories/GHSA-p5w6-75f9-cc2p","licence":"CC-BY-4.0","modified":"2026-06-25T23:11:45.634Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5530","url":"https://pkg.go.dev/vuln/GO-2026-5530","licence":"CC-BY-4.0","modified":"2026-06-25T23:01:21.670Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-40265","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-40265","licence":"Public domain","modified":"2026-10-26T22:10:00.163Z"}],"updatedAt":"2026-11-25T22:59:18.926Z","epss":{"score":0.00448,"percentile":0.40715,"date":"2026-12-01T12:00:22.000Z"}}