relationships.list discloses inaccessible document UUIDs when no anchor ID is supplied
Summary
relationships.list discloses inaccessible document UUIDs when no anchor ID is supplied
Summary
POST /api/relationships.list is meant to authorize its results against whichever document ID the caller supplied as the query anchor (documentId or reverseDocumentId). But `RelationshipsLi...
Affected packages
| Package | Affected → Fixed | |
|---|---|---|
| otherOutline |
< 1.10.0→ 1.10.0 |
1.10.0 |
Original description The description as published by the source.
relationships.list discloses inaccessible document UUIDs when no anchor ID is supplied
Summary
POST /api/relationships.list is meant to authorize its results against whichever document ID the caller supplied as the query anchor (documentId or reverseDocumentId). But RelationshipsListSchema makes every field optional, and the handler's fallback logic for an unsupplied anchor mistakenly treats every relationship's documentId as if it had been the caller-supplied, pre-authorized value — checking only reverseDocumentId instead. A team member who can read some document Q that links to (or is linked from) a private document P they cannot read can retrieve P's canonical UUID and relationship metadata via a single request with no query parameters at all.
Root cause
server/routes/api/relationships/relationships.ts, relationships.list handler. The sibling endpoint relationships.info always authorizes both sides of a relationship before returning it, because it requires an explicit relationship id. relationships.list instead accepts a fully optional query and tries to authorize based on whichever side the caller is treated as already knowing — but the schema doesn't enforce that one of documentId/reverseDocumentId must actually be supplied, so the "already known, don't re-check" side defaults incorrectly when neither is present:
const documents = await Document.findByIds(
relationships.flatMap((r) => where.reverseDocumentId ? r.documentId…
Source: GitHub Repository Security Advisories (Game のスタック) GitHub Advisory OSV
References
- GITHUB_REPO_ADVISORY outline/outline