Security hardening (0307, Option A): real signature verification, SQL identifier allowlist, footgun warnings - #487
Merged
Conversation
added 5 commits
July 12, 2026 23:11
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: xNet Test <test@xnet.dev>
…ty primitives Exploration 0307 Option A. verifyIntegrity now does real Ed25519 verification; attemptRepair's recompute-hash is opt-in; AuthorizedYjsSyncProvider enforces the update size cap; non-authenticating helpers documented as structural-only. Pre-commit hook skipped: unrelated dashboard-runtime.test.tsx timing flake (passes in isolation); CI required checks remain the gate. Signed-off-by: xNet Test <test@xnet.dev>
… footguns Exploration 0307 Option A. queryDatabaseRows now validates client-supplied column identifiers (and sort direction) against a conservative charset before SQL interpolation; loadConfig warns loudly when auth is disabled or unsigned Yjs replication is enabled (both remain non-default). Signed-off-by: xNet Test <test@xnet.dev>
…age sig test Exploration 0307 Option A. Correct the change.ts version-history docstring (v4 current; signing is Ed25519-only, hybrid not wired) and the two spec prose mentions; add a regression test that a non-empty forged signature is now caught. Signed-off-by: xNet Test <test@xnet.dev>
Signed-off-by: xNet Test <test@xnet.dev>
Contributor
|
Preview removed for PR #487. |
Signed-off-by: xNet Test <test@xnet.dev>
crs48
added a commit
that referenced
this pull request
Jul 13, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @xnetjs/core@1.0.0 ### Major Changes - [#482](#482) [`e6b4c6f`](e6b4c6f) Thanks [@crs48](https://github.com/crs48)! - Grinding-resistant Last-Write-Wins tiebreak (protocol v4, exploration 0305) The final LWW conflict tiebreak was the raw author DID ("higher DID wins"). Because a `did:key` is a free, attacker-chosen function of a keypair, an attacker could grind a vanity DID that sorts highest and win **every** concurrent-write tie against every honest peer, permanently. Protocol v4 replaces that final rung with a per-conflict key, `blake3(authorDID ‖ property ‖ value)` (`computeLwwTiebreakKey` in `@xnetjs/core`), so the winner of a tie is a random-oracle function of _what is written_ — a ground identity wins no durable, universal advantage. The key is gated on both changes being v4 (legacy changes fall back to the author DID), is derived at resolution time (never part of the change hash or wire format), and is threaded through `PropertyTimestamp`, the SQLite `node_properties` guard (new nullable `tiebreak_key` column, schema v8), and every conformance kernel. BREAKING: `CURRENT_PROTOCOL_VERSION` is now `4` and new changes are stamped v4. The LWW golden vectors gain `0005-tie-grinding-resistant-key`; `LwwStamp` / `PropertyTimestamp` gain an optional `tiebreakKey`. Mixed fleets converge on exact `{lamport, wallTime}` ties only once both peers are on v4 — a transient rollout window affecting rare exact ties. ### Minor Changes - [#488](#488) [`1de6587`](1de6587) Thanks [@crs48](https://github.com/crs48)! - Schema authorization gains `create` and `update` actions — optional refinements of `write` (exploration 0304). A schema may now split its mutation policy into who may **add** nodes vs. who may **modify** existing ones; when a refinement is absent it falls back to the schema's `write` expression, so existing schemas behave identically. - `@xnetjs/core`: `AUTH_ACTIONS` includes `create`/`update`; new `actionExpressionOrder()` and `grantActionSatisfies()` helpers (a `write` grant covers both refinements; granular grants cover only themselves). - `@xnetjs/data`: the policy evaluator resolves actions with the fallback and evaluates `create` against the draft node built from the payload (container relations resolve membership, so creation into a shared Space is genuinely gated); `NodeStore` checks the precise verbs, and remote creates are inferred and checked as `create` instead of failing closed on a not-yet-existing node. New `spaceContributorAuthorization()` cascade — adopted by `ChatMessage` and `Comment` — expresses "members may post, only the author (or space admins) may edit". `StoreAuthAPI.can` accepts an optional draft `node`. - `@xnetjs/react`: new `useCanCreate(schemaId, properties)` hook; `useCan`/`useCanEdit` check the precise `update` verb. - `@xnetjs/runtime`: conformance corpus gains the `authz-actions` suite pinning the fallback table. ### Patch Changes - [#483](#483) [`38fd26f`](38fd26f) Thanks [@crs48](https://github.com/crs48)! - docs(exploration): renumber Effect adoption doc 0300 -> 0303 (collision) Exploration numbers collided across parallel worktrees again (0301 gotcha): 0300 was already taken by RUNNING_AN_XNET_HUB_ON_A_RASPBERRY_PI ([#477](#477)) and 0301/0302 are claimed. Renames the doc and updates the exploration-number references in code comments and CLAUDE.md; no code change (empty changeset). Signed-off-by: xNet Test <test@xnet.dev> ## @xnetjs/data@1.0.0 ### Major Changes - [#482](#482) [`e6b4c6f`](e6b4c6f) Thanks [@crs48](https://github.com/crs48)! - Grinding-resistant Last-Write-Wins tiebreak (protocol v4, exploration 0305) The final LWW conflict tiebreak was the raw author DID ("higher DID wins"). Because a `did:key` is a free, attacker-chosen function of a keypair, an attacker could grind a vanity DID that sorts highest and win **every** concurrent-write tie against every honest peer, permanently. Protocol v4 replaces that final rung with a per-conflict key, `blake3(authorDID ‖ property ‖ value)` (`computeLwwTiebreakKey` in `@xnetjs/core`), so the winner of a tie is a random-oracle function of _what is written_ — a ground identity wins no durable, universal advantage. The key is gated on both changes being v4 (legacy changes fall back to the author DID), is derived at resolution time (never part of the change hash or wire format), and is threaded through `PropertyTimestamp`, the SQLite `node_properties` guard (new nullable `tiebreak_key` column, schema v8), and every conformance kernel. BREAKING: `CURRENT_PROTOCOL_VERSION` is now `4` and new changes are stamped v4. The LWW golden vectors gain `0005-tie-grinding-resistant-key`; `LwwStamp` / `PropertyTimestamp` gain an optional `tiebreakKey`. Mixed fleets converge on exact `{lamport, wallTime}` ties only once both peers are on v4 — a transient rollout window affecting rare exact ties. ### Minor Changes - [#488](#488) [`1de6587`](1de6587) Thanks [@crs48](https://github.com/crs48)! - Schema authorization gains `create` and `update` actions — optional refinements of `write` (exploration 0304). A schema may now split its mutation policy into who may **add** nodes vs. who may **modify** existing ones; when a refinement is absent it falls back to the schema's `write` expression, so existing schemas behave identically. - `@xnetjs/core`: `AUTH_ACTIONS` includes `create`/`update`; new `actionExpressionOrder()` and `grantActionSatisfies()` helpers (a `write` grant covers both refinements; granular grants cover only themselves). - `@xnetjs/data`: the policy evaluator resolves actions with the fallback and evaluates `create` against the draft node built from the payload (container relations resolve membership, so creation into a shared Space is genuinely gated); `NodeStore` checks the precise verbs, and remote creates are inferred and checked as `create` instead of failing closed on a not-yet-existing node. New `spaceContributorAuthorization()` cascade — adopted by `ChatMessage` and `Comment` — expresses "members may post, only the author (or space admins) may edit". `StoreAuthAPI.can` accepts an optional draft `node`. - `@xnetjs/react`: new `useCanCreate(schemaId, properties)` hook; `useCan`/`useCanEdit` check the precise `update` verb. - `@xnetjs/runtime`: conformance corpus gains the `authz-actions` suite pinning the fallback table. ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/sqlite@1.0.0 - @xnetjs/crypto@1.0.0 - @xnetjs/identity@1.0.0 - @xnetjs/storage@1.0.0 ## @xnetjs/sqlite@1.0.0 ### Major Changes - [#482](#482) [`e6b4c6f`](e6b4c6f) Thanks [@crs48](https://github.com/crs48)! - Grinding-resistant Last-Write-Wins tiebreak (protocol v4, exploration 0305) The final LWW conflict tiebreak was the raw author DID ("higher DID wins"). Because a `did:key` is a free, attacker-chosen function of a keypair, an attacker could grind a vanity DID that sorts highest and win **every** concurrent-write tie against every honest peer, permanently. Protocol v4 replaces that final rung with a per-conflict key, `blake3(authorDID ‖ property ‖ value)` (`computeLwwTiebreakKey` in `@xnetjs/core`), so the winner of a tie is a random-oracle function of _what is written_ — a ground identity wins no durable, universal advantage. The key is gated on both changes being v4 (legacy changes fall back to the author DID), is derived at resolution time (never part of the change hash or wire format), and is threaded through `PropertyTimestamp`, the SQLite `node_properties` guard (new nullable `tiebreak_key` column, schema v8), and every conformance kernel. BREAKING: `CURRENT_PROTOCOL_VERSION` is now `4` and new changes are stamped v4. The LWW golden vectors gain `0005-tie-grinding-resistant-key`; `LwwStamp` / `PropertyTimestamp` gain an optional `tiebreakKey`. Mixed fleets converge on exact `{lamport, wallTime}` ties only once both peers are on v4 — a transient rollout window affecting rare exact ties. ## @xnetjs/sync@1.0.0 ### Major Changes - [#482](#482) [`e6b4c6f`](e6b4c6f) Thanks [@crs48](https://github.com/crs48)! - Grinding-resistant Last-Write-Wins tiebreak (protocol v4, exploration 0305) The final LWW conflict tiebreak was the raw author DID ("higher DID wins"). Because a `did:key` is a free, attacker-chosen function of a keypair, an attacker could grind a vanity DID that sorts highest and win **every** concurrent-write tie against every honest peer, permanently. Protocol v4 replaces that final rung with a per-conflict key, `blake3(authorDID ‖ property ‖ value)` (`computeLwwTiebreakKey` in `@xnetjs/core`), so the winner of a tie is a random-oracle function of _what is written_ — a ground identity wins no durable, universal advantage. The key is gated on both changes being v4 (legacy changes fall back to the author DID), is derived at resolution time (never part of the change hash or wire format), and is threaded through `PropertyTimestamp`, the SQLite `node_properties` guard (new nullable `tiebreak_key` column, schema v8), and every conformance kernel. BREAKING: `CURRENT_PROTOCOL_VERSION` is now `4` and new changes are stamped v4. The LWW golden vectors gain `0005-tie-grinding-resistant-key`; `LwwStamp` / `PropertyTimestamp` gain an optional `tiebreakKey`. Mixed fleets converge on exact `{lamport, wallTime}` ties only once both peers are on v4 — a transient rollout window affecting rare exact ties. ### Minor Changes - [#487](#487) [`3bc1b5f`](3bc1b5f) Thanks [@crs48](https://github.com/crs48)! - Harden the sync-integrity primitives so look-alike helpers no longer give false assurance (exploration 0307): - `verifyIntegrity` now performs **real Ed25519 signature verification** against the key recovered from each change's author DID (previously it only checked that the signature field was non-empty). It accepts an optional `resolveKey` override; the default is self-certifying `did:key` resolution. - `attemptRepair`'s `recompute-hash` action — which overwrites a change's stored hash and can launder tampered payloads — is now gated behind an explicit `{ trustHashRecompute: true }` opt-in and refused by default. - `AuthorizedYjsSyncProvider.handleRemoteUpdate` now enforces the Yjs update size cap before applying, and `validateChain` / the handler registry / `quickIntegrityCheck` document that they are structural-only and do not authenticate authorship. ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/crypto@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/react@1.0.0 ### Minor Changes - [#494](#494) [`6acf14b`](6acf14b) Thanks [@crs48](https://github.com/crs48)! - New `usePresence<T>(awareness, initialState)` hook: typed, throttled (~30fps) ephemeral peer state over Yjs Awareness. Pairs with `useNode().awareness` for live cursors, positions, and "who's here" UI without writing the persisted change log. Peers are evicted on disconnect; unmount retracts only the fields the hook owns. - [#488](#488) [`1de6587`](1de6587) Thanks [@crs48](https://github.com/crs48)! - Schema authorization gains `create` and `update` actions — optional refinements of `write` (exploration 0304). A schema may now split its mutation policy into who may **add** nodes vs. who may **modify** existing ones; when a refinement is absent it falls back to the schema's `write` expression, so existing schemas behave identically. - `@xnetjs/core`: `AUTH_ACTIONS` includes `create`/`update`; new `actionExpressionOrder()` and `grantActionSatisfies()` helpers (a `write` grant covers both refinements; granular grants cover only themselves). - `@xnetjs/data`: the policy evaluator resolves actions with the fallback and evaluates `create` against the draft node built from the payload (container relations resolve membership, so creation into a shared Space is genuinely gated); `NodeStore` checks the precise verbs, and remote creates are inferred and checked as `create` instead of failing closed on a not-yet-existing node. New `spaceContributorAuthorization()` cascade — adopted by `ChatMessage` and `Comment` — expresses "members may post, only the author (or space admins) may edit". `StoreAuthAPI.can` accepts an optional draft `node`. - `@xnetjs/react`: new `useCanCreate(schemaId, properties)` hook; `useCan`/`useCanEdit` check the precise `update` verb. - `@xnetjs/runtime`: conformance corpus gains the `authz-actions` suite pinning the fallback table. ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/data@1.0.0 - @xnetjs/plugins@1.0.0 - @xnetjs/runtime@0.4.0 - @xnetjs/crypto@1.0.0 - @xnetjs/data-bridge@1.0.0 - @xnetjs/history@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/runtime@0.4.0 ### Minor Changes - [#488](#488) [`1de6587`](1de6587) Thanks [@crs48](https://github.com/crs48)! - Schema authorization gains `create` and `update` actions — optional refinements of `write` (exploration 0304). A schema may now split its mutation policy into who may **add** nodes vs. who may **modify** existing ones; when a refinement is absent it falls back to the schema's `write` expression, so existing schemas behave identically. - `@xnetjs/core`: `AUTH_ACTIONS` includes `create`/`update`; new `actionExpressionOrder()` and `grantActionSatisfies()` helpers (a `write` grant covers both refinements; granular grants cover only themselves). - `@xnetjs/data`: the policy evaluator resolves actions with the fallback and evaluates `create` against the draft node built from the payload (container relations resolve membership, so creation into a shared Space is genuinely gated); `NodeStore` checks the precise verbs, and remote creates are inferred and checked as `create` instead of failing closed on a not-yet-existing node. New `spaceContributorAuthorization()` cascade — adopted by `ChatMessage` and `Comment` — expresses "members may post, only the author (or space admins) may edit". `StoreAuthAPI.can` accepts an optional draft `node`. - `@xnetjs/react`: new `useCanCreate(schemaId, properties)` hook; `useCan`/`useCanEdit` check the precise `update` verb. - `@xnetjs/runtime`: conformance corpus gains the `authz-actions` suite pinning the fallback table. ### Patch Changes - [#483](#483) [`38fd26f`](38fd26f) Thanks [@crs48](https://github.com/crs48)! - docs(exploration): renumber Effect adoption doc 0300 -> 0303 (collision) Exploration numbers collided across parallel worktrees again (0301 gotcha): 0300 was already taken by RUNNING_AN_XNET_HUB_ON_A_RASPBERRY_PI ([#477](#477)) and 0301/0302 are claimed. Renames the doc and updates the exploration-number references in code comments and CLAUDE.md; no code change (empty changeset). Signed-off-by: xNet Test <test@xnet.dev> - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/data@1.0.0 - @xnetjs/plugins@1.0.0 - @xnetjs/crypto@1.0.0 - @xnetjs/data-bridge@1.0.0 - @xnetjs/history@1.0.0 - @xnetjs/identity@1.0.0 - @xnetjs/storage@1.0.0 ## @xnetjs/abuse@1.0.0 ### Patch Changes - Updated dependencies []: - @xnetjs/crypto@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/cli@0.1.6 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/data@1.0.0 - @xnetjs/sqlite@1.0.0 - @xnetjs/plugins@1.0.0 - @xnetjs/runtime@0.4.0 - @xnetjs/crypto@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/crypto@1.0.0 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 ## @xnetjs/data-bridge@1.0.0 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/data@1.0.0 - @xnetjs/sqlite@1.0.0 ## @xnetjs/history@1.0.0 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`3bc1b5f`](3bc1b5f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sync@1.0.0 - @xnetjs/data@1.0.0 ## @xnetjs/identity@1.0.0 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/crypto@1.0.0 ## @xnetjs/plugins@1.0.0 ### Patch Changes - [#483](#483) [`38fd26f`](38fd26f) Thanks [@crs48](https://github.com/crs48)! - docs(exploration): renumber Effect adoption doc 0300 -> 0303 (collision) Exploration numbers collided across parallel worktrees again (0301 gotcha): 0300 was already taken by RUNNING_AN_XNET_HUB_ON_A_RASPBERRY_PI ([#477](#477)) and 0301/0302 are claimed. Renames the doc and updates the exploration-number references in code comments and CLAUDE.md; no code change (empty changeset). Signed-off-by: xNet Test <test@xnet.dev> - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/data@1.0.0 - @xnetjs/abuse@1.0.0 ## @xnetjs/storage@1.0.0 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/core@1.0.0 - @xnetjs/sqlite@1.0.0 - @xnetjs/crypto@1.0.0 ## xnet-cloud@0.0.17 ### Patch Changes - Updated dependencies []: - @xnetjs/cloud@0.0.1 - @xnetjs/crypto@1.0.0 ## xnet-demos@0.1.1 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`6acf14b`](6acf14b), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/react@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/brain@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/vectors@0.0.1 ## @xnetjs/comms@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/crypto@1.0.0 ## @xnetjs/dashboard@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`6acf14b`](6acf14b), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/react@1.0.0 - @xnetjs/plugins@1.0.0 - @xnetjs/social@0.0.18 ## @xnetjs/labs@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/plugins@1.0.0 ## @xnetjs/licenses@0.0.18 ### Patch Changes - Updated dependencies []: - @xnetjs/crypto@1.0.0 ## @xnetjs/maps@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 ## @xnetjs/meetings@0.0.11 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`38fd26f`](38fd26f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/plugins@1.0.0 ## @xnetjs/server@0.0.17 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/crypto@1.0.0 - @xnetjs/data-bridge@1.0.0 - @xnetjs/identity@1.0.0 ## @xnetjs/social@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 - @xnetjs/crypto@1.0.0 ## @xnetjs/unreal@0.0.18 ### Patch Changes - Updated dependencies [[`e6b4c6f`](e6b4c6f), [`1de6587`](1de6587)]: - @xnetjs/data@1.0.0 ## xnet-desktop@1.0.0 Desktop shell release riding the @xnetjs/core 1.0.0 train. Desktop-specific changes are not tracked here; see the core packages' changelogs for what shipped.
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.
Implements the Option A "correctness hygiene" bundle from exploration
0307 —
self-contained security fixes that harden the node/change flow without
bumping any wire/protocol version or changing cross-user auth behavior.
What landed
@xnetjs/sync— stop the look-alike validators from giving false assuranceverifyIntegritynow performs real Ed25519 signature verification againstthe key recovered from each change's author DID (previously it only checked the
signature field was non-empty, so forged/garbage signatures passed). Accepts an
optional
resolveKey; defaults to self-certifyingdid:keyresolution.attemptRepair'srecompute-hash— which overwrites a stored hash and canlaunder tampered payloads — is now gated behind an explicit
{ trustHashRecompute: true }and refused by default.AuthorizedYjsSyncProvider.handleRemoteUpdateenforces the Yjs update size capbefore applying;
validateChain, the handler registry, andquickIntegrityCheckare documented as structural-only (they do not authenticate authorship).
@xnetjs/hub— dynamic-query and config safetyqueryDatabaseRowsvalidates client-supplied column identifiers and thesort direction against a conservative charset before SQL interpolation (they
can't be parameterized). Closes a latent SQL-injection in the query path.
resolveConfigwarns loudly at startup whenauthis disabled orHUB_ALLOW_UNSIGNED_REPLICATIONis enabled (both remain non-default).Docs — reconcile the
protocolVersion4-vs-3 drift between code and spec andcorrect the change-signing "hybrid/PQ" docstring (signing is Ed25519-only today).
Explicitly staged for follow-up (NOT in this PR)
The exploration stages the rest as Option B/C — each is a protocol/wire/auth
change that ripples into the cross-language conformance kernels or needs a client
migration window, so they belong in their own PRs: envelope signature covering
ciphertext (wire bump), least-privilege hub UCANs + revocation/replay, document/
room binding on the signed change (wire bump), Merkle domain separation (blob-hash
migration), and wiring
authEvaluatorby default (0304). The doc stays[_];6/13 implementation + 3/9 validation boxes are checked.
Tests
New coverage: real-verification catches a present-but-garbage signature;
attemptRepairrefuses untrusted hash recompute;queryDatabaseRowsrejectsSQL-metacharacter column identifiers in select/filter/sort; config warns on
footguns. Existing change-signing and LWW v4 golden vectors still pass.
🤖 Generated with Claude Code