Repository navigation
fix(runtime): applyActions rejects a refused redirect; i18n config compared by content - #756
Merged
Merged
Conversation
…mpared by content An Events Render of a region with `<c-i18n c-client>` compared the project's i18n configuration by `JSON.stringify` output, so a different key order failed the call. Formats are now compared by content, parsers by locale and locales as a set (#660). `navigateToRedirect` throws on a refused URL, so `Citry.events.applyActions()` rejects and later actions do not run. A redirect marked `wait: false` is still only logged. The browser plugin host's `csrfHeaders(url)` reads only a string or a `URL` and gives `{}` for any other value. Fixes #660 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED
JuroOravec
added a commit
that referenced
this pull request
Nov 18, 2026
Keeps both PRs' browser runtime changes: own-key reads (ownValue) from this branch and key-order-insensitive config comparison (sameJsonContent) from #756. Generated runtime files rebuilt. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED
JuroOravec
added a commit
that referenced
this pull request
Nov 18, 2026
) * docs(security): add review records for #754, #755, #756, #757 and #759 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED * docs(security): apply review findings to the 1.0.2 hardening records Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
What changes
Three fixes in Citry's browser runtime. This is the second of two pull requests; the first, #755, covers i18n own-key lookups (#701), form member reads (#703) and cookie reading. The two touch the same generated files, so whichever merges second needs a rebase and
node build.mjsinpackages/js/citry-client.Renderof a region with<c-i18n c-client>sends the project's i18n configuration again, and the server may list formats and parsers in another order.configureManifestused to compareJSON.stringifyoutput, so the call failed with "an i18n fragment uses a different project configuration". It now compares formats withsameJsonContent(object keys as a set, array order kept), parsers by locale, and locales as a set. The artifact merge check (artifactsAgree) uses the same compare.Citry.events.applyActions()rejects when a redirect is refused.navigateToRedirectnow throws on a refused URL (a scheme other thanhttp:/https:, a non-string, or a URL that leaves the page's origin), so the Promise rejects with that error and the actions after it do not run. Before, it logged and resolved. A redirect markedwait: falsestill only logs, since it does not hold up the call. A sent event call whose result holds such a redirect now fails and firescitry:events:error; the server already refuses those redirects, so only the experimentalon_event_resulthook can produce one.csrfHeadersreads only a string orURL. The browser plugin host'scsrfHeaders(url)gives{}for any other value. Before,String(request)on aRequestread as a path on the page's own origin.Docs:
events/actions.mdand theapplyActionssection ofreference/browser-apis.mddescribe the rejection;docs/design/security_csrf.mdand theRedirect(url=)row indocs/design/trust_boundaries.mdare updated.runtime.js,events.jsand the i18n plugin are rebuilt.Updated tests that encoded the old behavior:
redirect-scheme.test.mjscollected the refusal message fromconsole.error; it now collects it from the rejection.Checks
pnpm --dir packages/js/citry-client run check: 364 passed, 0 failed.i18n-configuration-order.test.mjs(3; the reordered-configuration case fails against themainsources),csrf-headers.test.mjs(1), and two redirect tests (rejection;wait: falselogs).test_i18n_events_render_e2e.py: twoRenders of a<c-i18n c-client>region with several format profiles. It fails with themaini18n plugin with the An Events revision of a region containing <c-i18n c-client> fails on a config key-order mismatch #660 error and passes now.ruff checkon the new test: clean.Review
An independent reviewer did a security pass (navigation, addresses and keys from the server, translated messages), checked the advisory survey kinds (open redirect, URL schemes, CSRF token leaks, prototype keys) and did a prose pass. It found no hole: no refused URL can navigate, and
sameJsonContenttells arrays and objects apart and compares__proto__keys as data. Its findings are applied: thewait: falsecase is documented and tested, andsecurity_csrf.mddescribes the newcsrfHeadersrule.Versioning
csrfHeaders: bug fixes.host.csrfHeadersis on the experimental browser plugin host and no user docs page teaches it.applyActions: maintainer decision. The docs said "the browser logs an error and stays on the page". The page still stays, but the Promise now rejects and later actions do not run, which changes a covered browser API. I treated it as a bug fix (a Promise that resolves when its action failed), so it fits a patch release (1.0.2). Under a strict reading it is a behavior change that wants a minor release or an "Upgrading" note.Fixes #660
🤖 Generated with Claude Code
https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED