Repository navigation
docs: map who may supply each input that reaches the page - #707
Merged
Merged
Conversation
…603) Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Correct what two extension hooks return, give the tr() URL note its own heading, define request data on each page, list the Citry UI URL schemes, drop an unproven nonce claim, and update the design doc's line references. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cache Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 of 15 tasks
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.
Closes #603.
To know whether request data may reach a Citry API, an app developer had to read the security page, the docstring, and often the code. This PR adds one design doc that answers it for every input that reaches the page, and adds the missing "never from request data" notes to the public docs.
What changes
docs/design/trust_boundaries.md(new). One table per area: template text, attributes (values, names, URLs), tags, slots and markers, template source and the sandbox, component data and assets, Vue and translated text, Events actions and requests, routes and responses, extension hooks and the render cache, the opt-in output checks, Citry UI, and Citry's browser runtime. Each row says who may supply the input (request data OK, app code, author only, or undecided with an issue link), what the browser does with it, which function checks it (file:line) on which render paths, and which page says so. Every row was taken from the code, then checked against the code by two independent security reviewers (see Review).docs/design/security-hardening.md,docs/agent/INDEX.md, and Mechanism 7 step 6 inCLAUDE.mdpoint to it.scripts/validators/trust_boundary_rows.pyfails when the doc does not name a publicExtensionmethod, a hook fired by name (emit("..."),_extensions_with_hook("...")), an Events action, or asecurity_*setting. It runs in thevalidatorsphase ofscripts/check.py(fast and full profiles) and takes about half a second. New template syntax and keyword arguments still rely on the security pass; a wider list (every function that returnsMarkup) was left out because it would need hand-kept exceptions.syntax/attributes.md(c-style),advanced/html-attributes.md(style,format_attrsnames),advanced/dynamic-components.md(c-is),advanced/js-and-css-dependencies.md(css_data()url(...)),advanced/dependency-files.md(library URLs,Script/Style),syntax/vue.md(v-html,:innerHTML,:srcdoc, URL bindings,:style,<component :is>,:onclick),i18n/rich-messages.md(tr()in a URL attribute),advanced/extensions.md(hooks that return source, hook-set URLs,on_dependencies),events/actions.md(Dispatchnames),reference/browser-apis.md(applyActions),ui-library/index.md(Citry UI URL schemes, attribute maps andstyle).Component.template_file,Script,Style,format_attrs,RouteResponse,I18nService.tr/resolve,I18nExtension.tr/resolve,Extension.on_slot_rendered, and theValueErrorofExtension.on_attrs_resolved.cmenu/api.md,csplitbutton/api.md) called a checked URL "trusted"; they now state the scheme rule.No code behaviour changes. No changelog entry: the user-visible part is docs and docstrings.
security.md#695 has merged, so this PR also edits
docs_site/content/security.md: "Check URL attributes" now names thecontentof<meta http-equiv="refresh">and theto,from,by, andvaluesof SVG<set>and<animate>, and a new section, "Protect the render cache", says that whoever can write the cache store can put HTML into the page.README.md,SECURITY.mdand_nav.ymlneed no change.Undecided rows and the issues they link
c-bindkey can write Citry's marker names (c-render-id,data-cid-*,data-ccss-*,data-citry-*).format_attrs()should refuse the namesc-bindrefuses.__proto__as a format profile or message id.Dispatchshould refuse names of standard DOM events.c-bind#601 (existing): whether core Citry checks URL schemes.None of these lets request data run script, as far as the reviews found.
The Citry UI section has one "known exception" row for the four inputs #697 fixes; delete it when #697 merges. The
ui-library/index.mdnote states the URL rule without that exception, so it is exact once #697 is in; both are planned for the same release.Checks
scripts/validate.py: all validators pass, including the new one.pytest packages/py/citry/tests/test_trust_boundary_rows_validator.py: 7 passed.ruff check,ruff format --check,mypy(also--platform linux) on the changed Python.Review
Three independent reviews ran on the change, plus a separate prose pass.
HTML commentandscript_jsonclaims, the ratings of the marker names and ofDispatchnames, missing rows (<component :is>,:style,on_event,on_event_error,security_script_integrity, CORS andCache-Control), the validator now also covering hooks fired by name, and manyfile:linereferences. The findings that need a code decision became Refuse Citry's own marker names in c-bind keys #699 to Decide whether Dispatch refuses names of standard DOM events #704.on_template_foreign_spansandon_messages_loadedreturn, moved thetr()URL note under its own heading, stated the<component :is>behaviour from the bundled Vue source, removed an unproven nonce claim fromapplyActions, defined "request data" on each page, listed the Citry UI scheme rules, split the densecsplitbuttonandextensionsparagraphs, and renamed thecsplitbuttonheading. Not applied: thecmenu"Trust boundary" heading and an olderTypeErrorsentence inon_attrs_resolved, which this change does not touch, and the URL list onsecurity.md, which docs: add the Versioning and support page #695 owns.🤖 Generated with Claude Code