Repository navigation
fix(db-sync): confine third-party OAuth tokens and harden the sync server - #13780
Closed
yuxi-liu-wired wants to merge 1 commit into
Closed
yuxi-liu-wired wants to merge 1 commit into
yuxi-liu-wired wants to merge 1 commit into
Conversation
yuxi-liu-wired
force-pushed
the
fix/db-sync-security
branch
from
October 16, 2026 17:48
03845bd to
cdf7a8d
Compare
…rver Security review follow-ups (H1, H3, M1-M4, L1, L2, L4, L5): - Third-party OAuth tokens (logseq/* scopes or additional Cognito client ids) are rejected on the native surface: /sync, /assets, /graphs, /e2ee, the PAT endpoint and the node WebSocket upgrade. The MCP code-mode guard checks the resolved URL origin and pathname. - Graph deletion requires a manager; /sync/<g>/admin/reset is 404 without the admin token; /internal/* tails are blocked in both dispatchers. - DB_SYNC_ALLOW_UNVERIFIED_JWT_CLAIMS falls back only on the JWKS- unreachable error; every other verification failure is a plain 401. - The x-graph-id header is gone; the sync path is authoritative. - Member removal closes the member's sockets on a new DO-internal route; expired tokens close their socket on the next message. - The DO routes the path exactly as received (no /sync prefix stripping), the node adapter blocks /semantic tails, and graph-e2ee is always set explicitly by dispatch. - Error responses carry no internal details (debug-*, error-detail). - Non-image asset types are served as attachment with nosniff; SVG gets a CSP sandbox. Plain-graph asset PUTs verify the declared checksum. - The node adapter no longer sends self-hosted users' tokens to api.logseq.com unless the issuer is Logseq's own pool. Note: the auth-claims catch handler returns false instead of nil and normalizes it, working around a promesa 11 bug: every nil resolution is one shared promise, and a task that throws during its drain rejects the other tasks of that drain.
yuxi-liu-wired
force-pushed
the
fix/db-sync-security
branch
from
October 16, 2026 18:36
cdf7a8d to
7aa794d
Compare
Contributor
Author
|
Combined with the other PRs that change the same files into #13781. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(db-sync): confine third-party OAuth tokens and harden the sync server
Security review follow-ups (H1, H3, M1-M4, L1, L2, L4, L5):
ids) are rejected on the native surface: /sync, /assets, /graphs, /e2ee,
the PAT endpoint and the node WebSocket upgrade. The MCP code-mode guard
checks the resolved URL origin and pathname.
the admin token; /internal/* tails are blocked in both dispatchers.
unreachable error; every other verification failure is a plain 401.
expired tokens close their socket on the next message.
the node adapter blocks /semantic tails, and graph-e2ee is always set
explicitly by dispatch.
CSP sandbox. Plain-graph asset PUTs verify the declared checksum.
api.logseq.com unless the issuer is Logseq's own pool.
Note: the auth-claims catch handler returns false instead of nil and
normalizes it, working around a promesa 11 bug: every nil resolution is
one shared promise, and a task that throws during its drain rejects the
other tasks of that drain.