{"id":"CVE-2026-77369","aliases":["CVE-2026-77369","GHSA-wj7x-58c2-5793","GO-2026-7016"],"related":[],"kind":"vulnerability","state":"published","title":"Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint","summary":"Daptin is a GraphQL/JSON-API headless CMS. From 0.11.4 until 0.12.30, the generic GET /yjs/:documentName WebSocket route in InitializeYjsResources requires a session but does not authorize the database resource selected by a typename.referenceId.columnName room name. The YJS initial-content provider then reads the selected file.* column without CanRead or CanUpdate checks, and bidirectional synchronization allows a low-privileged authenticated user to read or modify restricted row content. Unauthenticated requests are rejected, and standalone non-canonical room names remain shared-by-name rooms. This issue is fixed in version 0.12.30.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Daptin is a GraphQL/JSON-API headless CMS. From 0.11.4 until 0.12.30, the generic GET /yjs/:documentName WebSocket route in InitializeYjsResources requires a session but does not authorize the database resource selected by a typename.referenceId.columnName room name. The YJS initial-content provider then reads the selected file.* column without CanRead or CanUpdate checks, and bidirectional synchronization allows a low-privileged authenticated user to read or modify restricted row content. Unauthenticated requests are rejected, and standalone non-canonical room names remain shared-by-name rooms. This issue is fixed in version 0.12.30.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nDaptin registers a generic WebSocket endpoint, `GET /yjs/:documentName`, for real-time collaborative\ndocument editing (YJS/CRDT). Unlike its purpose-built sibling route, this generic endpoint performs\nno per-resource authorization check - it only verifies that *some* user session exists. Because the\ndocument store parses `:documentName` as `typename.referenceId.columnName` and fetches that row's\nreal column content unconditionally, any authenticated user (including a brand-new, zero-privilege,\nself-registered account) can read - and, since YJS sync is bidirectional, also write - the content\nof any `file.*`-typed column on any row of any table, including tables that are admin-only by\ndefault.\n\n### Details\n\n`InitializeYjsResources` (`server/endpoint_yjs.go`) registers two routes.\n\nThe purpose-built, correctly-secured route, registered once per `file.*`-typed column on every\ntable:\n\n```go\n// server/endpoint_yjs.go:47-113 (abridged)\npath := fmt.Sprintf(\"/live/%v/:referenceId/%v/yjs\", typename, columnInfo.ColumnName)\n...\nreturn func(ginContext *gin.Context) {\n    sessionUser := ...\n    if sessionUser == nil { ginContext.AbortWithStatus(403); return }\n    ...\n    object, _, getErr := cruds[typename].GetSingleRowByReferenceIdWithTransaction(typename, parsedId, nil, tx)\n    if getErr != nil { ginContext.AbortWithStatus(404); return }\n    ...\n    objectPermission := cruds[typename].GetRowPermission(object, tx2)\n    if !objectPermission.CanUpdate(user.UserReferenceId, user.Groups, cruds[typename].AdministratorGroupId) {\n        ginContext.AbortWithStatus(401)\n        return\n    }\n    roomName := fmt.Sprintf(\"%v%v%v%v%v\", typename, \".\", referenceId, \".\", columnInfo.ColumnName)\n    ...\n    yjsConnectionHandler(ginContext.Writer, ginContext.Request)\n}\n```\n\nThis route correctly requires a session, loads the actual row, and checks\n`objectPermission.CanUpdate(...)` for the specific requesting user before allowing the WebSocket\nupgrade.\n\nA second, generic route is registered right above it, with none of those checks:\n\n```go\n// server/endpoint_yjs.go:27-38\ndefaultRouter.GET(\"/yjs/:documentName\", func(ginContext *gin.Context) {\n    sessionUser := ginContext.Request.Context().Value(\"user\")\n    if sessionUser == nil {\n        ginContext.AbortWithStatus(403)\n        return\n    }\n    yjsConnectionHandler(ginContext.Writer, ginContext.Request)\n})\n```\n\nThe only gate here is \"is some session present\" - there is no lookup of the referenced row, no\n`GetRowPermission`, no `CanUpdate`/`CanRead` check at all. `:documentName` is taken verbatim from\nthe URL and handed straight to `yjsConnectionHandler`.\n\nThe YJS document store's content provider parses `documentName` using exactly the\n`typename.referenceId.columnName` convention the secure route builds internally as `roomName`, and\nuses it to fetch the real row from the database with no authorization check of its own:\n\n```go\n// server/yjs_doucment_provider.go:41-115 (abridged)\nydb.WithInitialContentProvider(func(documentPath string) []byte {\n    pathParts := strings.Split(documentPath, \".\")\n    typeName, referenceId, columnName := pathParts[0], pathParts[1], pathParts[2]\n    crud := cruds[typeName]\n    object, _, getErr := crud.GetSingleRowByReferenceIdWithTransaction(typeName, parsedId,\n        map[string]bool{columnName: true}, tx)\n    ...\n    // decodes and returns the actual file/column content, base64-decoded, as the\n    // initial content of the shared collaborative document\n})\n```\n\nBecause the generic route performs no permission check, any authenticated user can supply\n`documentName = \"<any table>.<any reference_id>.<any file.* column>\"` and the initial YJS sync will\nserve them that row's real content - including rows whose table has `DefaultGroups: adminsGroup`\n(admin-only by default, e.g. the built-in `calendar` table) or rows an ordinary user's own row-level\npermissions would otherwise forbid them from reading. Since YJS sync is bidirectional, a connected\nclient can also push edits, which legitimate collaborators may later pull back in through the\ncorrectly secured `/live/...` route, giving a write/corruption path as well as a read path.\n\n### PoC\n\nBuilt and ran current HEAD in a clean container; created two accounts (`admin@admin.com`, first\nsignup -> admin; `bob@bob.com`, second signup -> ordinary, non-admin user with default permissions\nonly):\n\n```bash\n# 1) Generic endpoint accepts ANY authenticated session for ANY document name,\n#    including a syntactically-valid-but-nonexistent reference_id on an admin-only table:\ncurl -i -N \\\n  -H \"Authorization: Bearer $BOB_TOKEN\" \\\n  -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" \\\n  -H \"Sec-WebSocket-Version: 13\" -H \"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\" \\\n  \"http://localhost:6336/yjs/calendar.deadbeef-0000-0000-0000-000000000000.content\"\n# => HTTP/1.1 101 Switching Protocols        <-- ACCEPTED, no ownership/permission check at all\n\n# 2) The purpose-built, secured sibling route correctly validates the very same identifier:\ncurl -i -N \\\n  -H \"Authorization: Bearer $BOB_TOKEN\" \\\n  -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" \\\n  -H \"Sec-WebSocket-Version: 13\" -H \"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\" \\\n  \"http://localhost:6336/live/calendar/deadbeef-0000-0000-0000-000000000000/content/yjs\"\n# => HTTP/1.1 404 Not Found                  <-- looks the row up, would 401 if it existed and Bob lacked access\n\n# 3) Sanity check: the generic endpoint DOES require *some* session (not fully unauthenticated) --\n#    the flaw is specifically the missing per-resource check, not a missing session check:\ncurl -i -N \\\n  -H \"Connection: Upgrade\" -H \"Upgrade: websocket\" \\\n  -H \"Sec-WebSocket-Version: 13\" -H \"Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\" \\\n  \"http://localhost:6336/yjs/calendar.deadbeef-0000-0000-0000-000000000000.content\"\n# => HTTP/1.1 403 Forbidden\n```\n\n`bob@bob.com` has zero relationship to the `calendar` table (whose `DefaultGroups` is `adminsGroup`\n- admin-only by default) or to the fabricated reference ID, yet the generic route unconditionally\nupgrades the connection for him. Any real row's `typename.referenceId.columnName` - reference IDs\nroutinely appear in ordinary list/read API responses even when the sensitive column itself is\nrestricted - is enough to pull that column's actual content through this side channel, fully\nbypassing the row/column permission system that the sibling `/live/...` route (and the rest of\nDaptin's permission model) correctly enforces.\n\n### Impact\n\n- **Confidentiality:** any signed-up user, including a brand-new self-registered account with no\n  group memberships, can read the live content of any `file.*`-typed column on any row of any\n  table - including tables that are admin-only by default (e.g. `calendar`) and rows whose\n  row-level permissions would otherwise block that user - by supplying the right\n  `typename.referenceId.columnName` triple to `GET /yjs/:documentName`.\n- **Integrity:** because YJS sync is bidirectional CRDT replication, the same low-privileged\n  connection can push edits into the shared document; those edits are visible to any legitimate\n  collaborator who later opens the same document through the correctly-secured `/live/...` route.\n- **Who is impacted:** every Daptin deployment with at least one `file.*`-typed column (built-in\n  examples: `calendar.content` (`file.ical`), the generic document table's `document_content`\n  (`file.*`), and any custom table an admin defines with a `file.xxx` column type), since the\n  vulnerable route is registered generically for every such column across every table at startup.\n  Any user able to self-register (open signup is the default) is sufficient to exploit this.\n\n### Resolution\n\nFixed on the default branch in daptin/daptin@a1a3c48f. Canonical database-backed YJS rooms now use the same row lookup and existing PermissionInstance.CanUpdate/CanRead authorization for both /yjs/:documentName and /live/... routes. Update permission grants read-write access; read-only permission grants a read-only YJS session; unauthorized and missing resources fail closed with 404. Standalone non-canonical room names retain their existing authenticated, shared-by-name behavior. The initial-content provider now validates the exact canonical form, UUID, table, and file.* column before database access.\n\nRead-only protocol enforcement is provided by artpar/ydb v0.4.1 (artpar/ydb@b79b01a), which fully consumes but drops all client YJS sync write subtypes while continuing to deliver history and broadcasts.\n\nVerification included YDB race tests for all sync subtypes, concatenated-frame handling, persistence/broadcast suppression, catch-up, and connection continuity; Daptin permission/parser unit tests; the full Daptin test suite; server race tests; go vet; and a fresh-instance CLI/WebSocket exercise covering authentication, fail-closed canonical routes, standalone compatibility, and canonical/live cross-route relay.\n\nNo patched Daptin version is listed until a release containing a1a3c48f is published.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint in github.com/daptin/daptin","format":"markdown","source":"go"}],"published":"2026-11-19T16:32:17.515Z","modified":"2026-11-23T20:41:05.629Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N","score":9.6,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N","score":9.6,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:N","score":9.6,"rating":"CRITICAL"}],"cwes":["CWE-639","CWE-862","CWE-863"],"affected":[{"ranges":[{"version":">= 0.11.4, < 0.12.30","status":"affected"}],"vendor":"daptin","product":"daptin","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0.11.4","status":"affected","fixed":"0.12.30"}],"ecosystem":"Go","package":"github.com/daptin/daptin","purl":"pkg:golang/github.com/daptin/daptin","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.11.4","status":"affected","fixed":"0.12.30"}],"ecosystem":"Go","package":"github.com/daptin/daptin","purl":"pkg:golang/github.com/daptin/daptin","source":"go"}],"references":[{"url":"https://github.com/daptin/daptin/security/advisories/GHSA-wj7x-58c2-5793","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/daptin/daptin/commit/a1a3c48f88ce30632a57d3fe6a971033b23bd394","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/daptin/daptin/releases/tag/v0.12.30","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77369","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/daptin/daptin","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"total","date":"2026-11-19T19:01:39.253Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-77369","url":"https://www.cve.org/CVERecord?id=CVE-2026-77369","licence":"CVE Terms of Use","modified":"2026-11-19T19:02:27.060Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-wj7x-58c2-5793","url":"https://github.com/advisories/GHSA-wj7x-58c2-5793","licence":"CC-BY-4.0","modified":"2026-11-23T20:41:05.629Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-7016","url":"https://pkg.go.dev/vuln/GO-2026-7016","licence":"CC-BY-4.0","modified":"2026-11-23T20:30:15.815Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-77369","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77369","licence":"Public domain","modified":"2026-11-19T19:17:33.003Z"}],"updatedAt":"2026-11-25T22:59:52.152Z","epss":{"score":0.00449,"percentile":0.30876,"date":"2026-11-30T12:00:22.000Z"}}