Repository navigation
fix(web): check untrusted JSON and hub values against their schemas - #169
Merged
TheGreatAxios merged 4 commits intoNov 4, 2026
Conversation
TheGreatAxios
force-pushed
the
cl-12110-check-untrusted-json-and-casts-in-the-interface
branch
from
November 4, 2026 21:50
b5dede4 to
80edb8b
Compare
|
Triage: In progress Triage is waiting for CI to finish before it decides. This comment shows the verdict once it has. |
corbits-triage
Bot
dismissed
their stale review
November 4, 2026 22:08
Nothing triage asked to change still fails, so this request no longer stands.
* fix(client): read login base URLs from a map keyed by login plugin * fix(web): refuse unreadable custom models instead of sending null
TheGreatAxios
force-pushed
the
cl-12110-check-untrusted-json-and-casts-in-the-interface
branch
from
November 4, 2026 22:30
40483d7 to
0168c8e
Compare
TheGreatAxios
merged commit Nov 4, 2026
69a62c5
into
cl-12110-remove-swallowed-errors-unchecked-casts-and-iifes-from-the
2 checks passed
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.
Part of CL-12110: the untrusted-JSON and unchecked-cast items from the Findings document, except the approval-package deck (#168). Stacked on #167.
Changes
readJson(text, schema)inapps/web/src/json.ts: catches onlySyntaxError, validates with arktype, and returns null for either failure.runframes are validated against a local schema of the fields the interface reads; a frame of the wrong shape is logged (without its contents) and dropped instead of reaching the transcript. A tool frame's stringpartialis accepted, and readers narrow it throughpartialOf.DesignBundlefrom@corbits-builder/schemas, so a bundle whose files aren't strings shows the unreadable state.nullor scalar no longer throws on.result; it reads as text.message,error.message,user) instead of a cast. Only better-auth's JSONnullmeans signed out; a session reply of any other wrong shape is now an error instead of quietly showing the sign-in screen.load-room.ts: the try/catch around parsing the settled keys is removed; every key is aroomDocumentKey, which always parses.as unknown as numbertimers inrun-stream.tsandroom-reload.tsusewindow.setTimeout.DesignConcept.array(), so the length limits apply.ModelLoginPluginis now an arktype schema inpackages/schemas(the client type re-exports it), and an unknown plugin toasts a readable error instead of being sent to the hub.CustomApi, instead of casting it. The hub already asserts this when it lists custom providers.type("string[]")instead of casts.packages/schemaschanges on purpose although the issue lists onlyapps/webandpackages/client: shared client/hub shapes belong there. Run-stream events and the auth body are read only by the interface, so their schemas stay inapps/web. The hub keeps its own list of login plugins inapps/hub, which this issue doesn't touch; making the hub importModelLoginPluginis a follow-up.Verification
nullmail reads as text; only a JSONnullsession means signed out.bun run lint,format:check,typecheck,test,pins:verifyandvendor:verifypass.