CVE-2026-77369: Daptin: Broken Access Control (IDOR) in the generic YJS collaboration endpoint
Critical CVSS 9.6
- OSV id
- GHSA-wj7x-58c2-5793
- Also known as
- CVE-2026-77369
- Published
- Last modified
Affected packages
| Package | Affected versions | Fixed in |
|---|---|---|
| github.com/daptin/daptin Go |
>= 0.11.4, < 0.12.30 | 0.12.30 |
How to fix it
Upgrade github.com/daptin/daptin to 0.12.30 or later.
go get github.com/daptin/daptin@v0.12.30
go mod tidy
- Indirect Go modules are upgraded the same way (`go get module@version`).
- Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.
Not sure whether your project uses an affected version? Check your lockfile below for free.
Details
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/endpoint_yjs.go) registers two routes.
The purpose-built, correctly-secured route, registered once per file.*-typed column on every
table:
// server/endpoint_yjs.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:
// server/endpoint_yjs.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:
// server/yjs_doucment_provider.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 reference_id>.<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 reference_id on an admin-only table:
curl -i -N \ -H "Authorization: Bearer $BOB_TOKEN" \ -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 i
References
- GHSA-wj7x-58c2-5793 on OSV.dev
- Web: https://github.com/daptin/daptin/security/advisories/GHSA-wj7x-58c2-5793
- Advisory: https://nvd.nist.gov/vuln/detail/CVE-2026-77369
- Web: https://github.com/daptin/daptin/commit/a1a3c48f88ce30632a57d3fe6a971033b23bd394
- Package: https://github.com/daptin/daptin
- Web: https://github.com/daptin/daptin/releases/tag/v0.12.30
Am I affected?
Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.
About this data
Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.