GO-2026-7016: Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint

Published Nov 20, 2026
·
Updated

Summary

Daptin registers a generic WebSocket endpoint, GET /yjs/:documentName, for real-time collaborative document editing (YJS/CRDT). Unlike its purpose-built sibling route, this generic endpoint performs no per-resource authorization check - it only verifies that some user session exists. Because the document store parses :documentName as typename.referenceId.columnName and fetches that row's real column content unconditionally, any authenticated user (including a brand-new, zero-privilege, self-registered account) can read - and, since YJS sync is bidirectional, also write - the content of any file.-typed column on any row of any table, including tables that are admin-only by default.

Details

InitializeYjsResources (server/endpointyjs.go) registers two routes.

The purpose-built, correctly-secured route, registered once per file.-typed column on every table:

go // server/endpointyjs.go:47-113 (abridged) path := fmt.Sprintf("/live/%v/:referenceId/%v/yjs", typename, columnInfo.ColumnName) ... return func(ginContext gin.Context) { sessionUser := ... if sessionUser == nil { ginContext.AbortWithStatus(403); return } ... object, , getErr := cruds[typename].GetSingleRowByReferenceIdWithTransaction(typename, parsedId, nil, tx) if getErr != nil { ginContext.AbortWithStatus(404); return } ... objectPermission := cruds[typename].GetRowPermission(object, tx2) if !objectPermission.CanUpdate(user.UserReferenceId, user.Groups, cruds[typename].AdministratorGroupId) { ginContext.AbortWithStatus(401) return } roomName := fmt.Sprintf("%v%v%v%v%v", typename, ".", referenceId, ".", columnInfo.ColumnName) ... yjsConnectionHandler(ginContext.Writer, ginContext.Request) }

This route correctly requires a session, loads the actual row, and checks objectPermission.CanUpdate(...) for the specific requesting user before allowing the WebSocket upgrade.

A second, generic route is registered right above it, with none of those checks:

go // server/endpointyjs.go:27-38 defaultRouter.GET("/yjs/:documentName", func(ginContext gin.Context) { sessionUser := ginContext.Request.Context().Value("user") if sessionUser == nil { ginContext.AbortWithStatus(403) return } yjsConnectionHandler(ginContext.Writer, ginContext.Request) })

The only gate here is "is some session present" - there is no lookup of the referenced row, no GetRowPermission, no CanUpdate/CanRead check at all. :documentName is taken verbatim from the URL and handed straight to yjsConnectionHandler.

The YJS document store's content provider parses documentName using exactly the typename.referenceId.columnName convention the secure route builds internally as roomName, and uses it to fetch the real row from the database with no authorization check of its own:

go // server/yjsdoucmentprovider.go:41-115 (abridged) ydb.WithInitialContentProvider(func(documentPath string) []byte { pathParts := strings.Split(documentPath, ".") typeName, referenceId, columnName := pathParts[0], pathParts[1], pathParts[2] crud := cruds[typeName] object, , getErr := crud.GetSingleRowByReferenceIdWithTransaction(typeName, parsedId, map[string]bool{columnName: true}, tx) ... // decodes and returns the actual file/column content, base64-decoded, as the // initial content of the shared collaborative document })

Because the generic route performs no permission check, any authenticated user can supply documentName = "<any table>.<any referenceid>.<any file. column>" and the initial YJS sync will serve them that row's real content - including rows whose table has DefaultGroups: adminsGroup (admin-only by default, e.g. the built-in calendar table) or rows an ordinary user's own row-level permissions would otherwise forbid them from reading. Since YJS sync is bidirectional, a connected client can also push edits, which legitimate collaborators may later pull back in through the correctly secured /live/... route, giving a write/corruption path as well as a read path.

PoC

Built and ran current HEAD in a clean container; created two accounts (admin@admin.com, first signup -> admin; bob@bob.com, second signup -> ordinary, non-admin user with default permissions only):

bash 1) Generic endpoint accepts ANY authenticated session for ANY document name, including a syntactically-valid-but-nonexistent referenceid on an admin-only table: curl -i -N \ -H "Authorization: Bearer $BOBTOKEN" \ -H "Connection: Upgrade" -H "Upgrade: websocket" \ -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \ "http://localhost:6336/yjs/calendar.deadbeef-0000-0000-0000-000000000000.content" => HTTP/1.1 101 Switching Protocols <-- ACCEPTED, no ownership/permission check at all

2) The purpose-built, secured sibling route correctly validates the very same identifier: curl -i -N \ -H "Authorization: Bearer $BOBTOKEN" \ -H "Connection: Upgrade" -H "Upgrade: websocket" \ -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \ "http://localhost:6336/live/calendar/deadbeef-0000-0000-0000-000000000000/content/yjs" => HTTP/1.1 404 Not Found <-- looks the row up, would 401 if it existed and Bob lacked access

3) Sanity check: the generic endpoint DOES require some session (not fully unauthenticated) -- the flaw is specifically the missing per-resource check, not a missing session check: curl -i -N \ -H "Connection: Upgrade" -H "Upgrade: websocket" \ -H "Sec-WebSocket-Version: 13" -H "Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==" \ "http://localhost:6336/yjs/calendar.deadbeef-0000-0000-0000-000000000000.content" => HTTP/1.1 403 Forbidden

bob@bob.com has zero relationship to the calendar table (whose DefaultGroups is adminsGroup - admin-only by default) or to the fabricated reference ID, yet the generic route unconditionally upgrades the connection for him. Any real row's typename.referenceId.columnName - reference IDs routinely appear in ordinary list/read API responses even when the sensitive column itself is restricted - is enough to pull that column's actual content through this side channel, fully bypassing the row/column permission system that the sibling /live/... route (and the rest of Daptin's permission model) correctly enforces.

Impact

- Confidentiality: any signed-up user, including a brand-new self-registered account with no group memberships, can read the live content of any file.-typed column on any row of any table - including tables that are admin-only by default (e.g. calendar) and rows whose row-level permissions would otherwise block that user - by supplying the right typename.referenceId.columnName triple to GET /yjs/:documentName. - Integrity: because YJS sync is bidirectional CRDT replication, the same low-privileged connection can push edits into the shared document; those edits are visible to any legitimate collaborator who later opens the same document through the correctly-secured /live/... route. - Who is impacted: every Daptin deployment with at least one file.-typed column (built-in examples: calendar.content (file.ical), the generic document table's documentcontent (file.), and any custom table an admin defines with a file.xxx column type), since the vulnerable route is registered generically for every such column across every table at startup. Any user able to self-register (open signup is the default) is sufficient to exploit this.

Resolution

Fixed 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.

Read-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.

Verification 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.

No patched Daptin version is listed until a release containing a1a3c48f is published.

Other sources

Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint in github.com/daptin/daptin

— OSV

Affected Software

1 affected componentFixes available
go/github.com/daptin/daptin>=0.11.4<0.12.30
0.12.30

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade go/github.com/daptin/daptin to a version that resolves this vulnerability.

    Fixed in 0.12.30
  2. Upgrade

    Upgrade github.com/daptin/daptin to a version that resolves this vulnerability.

    Patch daptin/daptin@a1a3c48f
  3. Upgrade

    Upgrade artpar/ydb to a version that resolves this vulnerability.

    Fixed in v0.4.1

Event History

Nov 20, 2026
Advisory Published
via OSV·12:14 AM
Data Sourced
via OSV·12:14 AM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What level of access does an attacker need?

The attacker only needs an authenticated user session. A newly self-registered account with zero privileges is sufficient; no administrative or per-resource permission is required.

2

Which resources can be accessed through the affected endpoint?

Any file.*-typed column on any row of any table can be read and modified through the generic collaboration endpoint. This includes content in tables that are admin-only by default.

3

How is the target resource identified?

The endpoint accepts a document name in the form typename.referenceId.columnName. The document store uses those values to fetch the corresponding row and column content.

4

Can this issue alter data as well as disclose it?

Yes. YJS synchronization is bidirectional, so an authenticated attacker can write changed content back to the targeted file.* column as well as read it.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203