{"id":"CVE-2026-50554","aliases":["CVE-2026-50554","GHSA-588f-fvcv-xhvf","GO-2026-5948"],"related":[],"kind":"vulnerability","state":"published","title":"Note Mark: Unauthenticated disclosure of soft-deleted note metadata via deleted=true on public books in note-mark","summary":"Note Mark is an open-source note-taking application. Prior to version 0.19.5, GET /api/books/{bookID}/notes is an unauthenticated endpoint that accepts a \"deleted\" query parameter. When the request is ?deleted=true, the service runs the query with Unscoped() (bypassing GORM's soft-delete scope) but keeps the read-authorization clause as \"owner_id = ? OR is_public = ?\". As a result, any unauthenticated caller can enumerate the metadata of soft-deleted (\"trashed\") notes belonging to any public book — notes the owner explicitly deleted and expected to be removed from public view. This issue has been patched in version 0.19.5.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Note Mark is an open-source note-taking application. Prior to version 0.19.5, GET /api/books/{bookID}/notes is an unauthenticated endpoint that accepts a \"deleted\" query parameter. When the request is ?deleted=true, the service runs the query with Unscoped() (bypassing GORM's soft-delete scope) but keeps the read-authorization clause as \"owner_id = ? OR is_public = ?\". As a result, any unauthenticated caller can enumerate the metadata of soft-deleted (\"trashed\") notes belonging to any public book — notes the owner explicitly deleted and expected to be removed from public view. This issue has been patched in version 0.19.5.","source":"cvelist"},{"lang":"en","text":"Summary\n\n  GET /api/books/{bookID}/notes is an unauthenticated endpoint that accepts a \"deleted\" query parameter. When the request is ?deleted=true, the\n  service runs the query with Unscoped() (bypassing GORM's soft-delete scope) but keeps the read-authorization clause as \"owner_id = ? OR is_public\n  = ?\". As a result, any unauthenticated caller can enumerate the metadata of soft-deleted (\"trashed\") notes belonging to any public book — notes\n  the owner explicitly deleted and expected to be removed from public view.\n\n  Affected component (code-verified)\n\n  backend/services/notes.go — GetNotesByBookID (lines 72-89):\n\n  func (s NotesService) GetNotesByBookID(currentUserID *uuid.UUID, bookID uuid.UUID, deleted bool) ([]db.Note, error) {\n        tx := db.DB\n        if deleted {\n                tx = tx.Unscoped() // <-- bypasses soft-delete scope\n        }\n        tx = tx.\n                Preload(\"Book\").\n                Joins(\"JOIN books ON books.id = notes.book_id\").\n                Where(\n                        db.DB.Where(\"books.id = ?\", bookID),\n                        db.DB.Where(\"owner_id = ? OR is_public = ?\", currentUserID, true), // <-- is_public still honored for trash\n                )\n        if deleted {\n                tx = tx.Where(\"notes.deleted_at IS NOT NULL\")\n        }\n        var notes []db.Note\n        return notes, dbErrorToServiceError(tx.Find(&notes).Error)\n  }\n\n  Route registration confirms the endpoint has no AuthRequiredMiddleware (backend/handlers/notes.go:37), and the deleted flag is attacker-controlled\n   (backend/handlers/notes.go:86 — Deleted bool with query:\"deleted\").\n\n  Proof of concept\n\n  1. A victim owns a public book (is_public = true), creates a note, then soft-deletes it (moves it to trash). The note still exists in the DB with\n  deleted_at set.\n  2. An unauthenticated attacker who knows (or enumerates) the book UUID requests: GET /api/books/<bookID>/notes?deleted=true\n  3. The response lists the soft-deleted note(s) — id, title, slug, timestamps — even though the attacker is not authenticated and the owner\n  intended the note to be deleted.\n\n  Impact\n\n  Exposure of soft-deleted note metadata (title, slug, timestamps) of public books to unauthenticated actors. The note body is not exposed — the\n  content endpoint (GetNoteContent) does not use Unscoped(), so its count query returns 0 for soft-deleted notes and yields 404. Impact is therefore\n   limited to metadata disclosure and the bypass of the intended \"delete\" semantics on public books.\n\n  Remediation\n\n  Restrict trash (soft-deleted) listings to the book owner only — never honor the is_public branch when deleted=true:\n\n   func (s NotesService) GetNotesByBookID(currentUserID *uuid.UUID, bookID uuid.UUID, deleted bool) ([]db.Note, error) {\n        tx := db.DB\n        if deleted {\n                tx = tx.Unscoped()\n        }\n  +     // Soft-deleted (\"trash\") notes must only ever be listed to the book owner.\n  +     authz := db.DB.Where(\"owner_id = ? OR is_public = ?\", currentUserID, true)\n  +     if deleted {\n  +             authz = db.DB.Where(\"owner_id = ?\", currentUserID)\n  +     }\n        tx = tx.\n                Preload(\"Book\").\n                Joins(\"JOIN books ON books.id = notes.book_id\").\n                Where(\n                        db.DB.Where(\"books.id = ?\", bookID),\n  -                     db.DB.Where(\"owner_id = ? OR is_public = ?\", currentUserID, true),\n  +                     authz,\n                )\n        if deleted {\n                tx = tx.Where(\"notes.deleted_at IS NOT NULL\")\n        }\n        var notes []db.Note\n        return notes, dbErrorToServiceError(tx.Find(&notes).Error)\n   }\n\n  With this change, when currentUserID is nil (unauthenticated) and deleted=true, the clause becomes owner_id = NULL, which matches nothing — so\n  trash is never exposed to anonymous callers.\n\n  Coordinated disclosure / CVE request\n\n  We have reported this privately and are happy to assist with any further validation or testing you need. If you agree this qualifies as a security\n   vulnerability, we would be grateful if you could request a CVE ID for it — GitHub lets maintainers request a CVE directly from this advisory page\n   once it is accepted. Thank you for your time and for maintaining note-mark.\n\n  References\n\n  - CWE-200: Exposure of Sensitive Information to an Unauthorized Actor\n  - CWE-285: Improper Authorization\n  - Prior note-mark authorization fix (CVE-2026-40265) established that read paths must scope by owner_id OR is_public; this report covers the trash\n   path that the scope did not fully cover.\n\n  ---","format":"markdown","source":"ghsa"},{"lang":"en","text":"Note Mark: Unauthenticated disclosure of soft-deleted note metadata via deleted=true on public books in github.com/enchant97/note-mark/backend","format":"markdown","source":"go"}],"published":"2026-07-09T13:41:29.000Z","modified":"2026-09-09T21:09:13.080Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N","score":5.3,"rating":"MEDIUM"}],"cwes":["CWE-200","CWE-285"],"affected":[{"ranges":[{"version":"< 0.19.5","status":"affected"}],"vendor":"enchant97","product":"note-mark","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.0.0-20260601210758-9c9b72740f22"}],"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-20260601210758-9c9b72740f22"}],"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-588f-fvcv-xhvf","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/enchant97/note-mark/commit/9c9b72740f22a06131a8f64b53bb08e3b05b81a6","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/enchant97/note-mark/releases/tag/v0.19.5","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/enchant97/note-mark","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-09-03T15:56:08.738Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-50554","url":"https://www.cve.org/CVERecord?id=CVE-2026-50554","licence":"CVE Terms of Use","modified":"2026-09-03T15:56:23.983Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-588f-fvcv-xhvf","url":"https://github.com/advisories/GHSA-588f-fvcv-xhvf","licence":"CC-BY-4.0","modified":"2026-07-21T19:19:11.129Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5948","url":"https://pkg.go.dev/vuln/GO-2026-5948","licence":"CC-BY-4.0","modified":"2026-07-21T19:15:26.348Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-50554","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-50554","licence":"Public domain","modified":"2026-09-09T21:09:13.080Z"}],"updatedAt":"2026-11-25T22:59:36.194Z","epss":{"score":0.00306,"percentile":0.25192,"date":"2026-12-01T12:00:22.000Z"}}