Repository navigation
fix: refuse Citry's reserved attribute names as c-bind keys - #713
Merged
Merged
Conversation
On an HTML element, a c-bind key may no longer be c-render-id, data-cid, data-cid-*, data-ccss-*, or a data-citry-* name core Citry reads, and a <c-element> that has c-is or c-bind refuses these names whether the template wrote them or data passed them in. Citry uses these names to find its own elements and placeholders in the page, so a name taken from request data could make the server copy another component's HTML into a second place on the page. One check, reject_citry_marker_attr_name in citry/attrs.py, runs everywhere c-bind is applied to an element: the node path, the Vue leaf programs (full merge and the fast root-spread plan), elements with a $c-tr binding, and <c-element>. Closes #699 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This was referenced Nov 15, 2026
This was referenced Nov 15, 2026
JuroOravec
added a commit
that referenced
this pull request
Nov 16, 2026
* docs: record the security reviews of #713, #714, #718 and #722 Adds the Mechanism 7 step 7 records for four merged pull requests: GHSA-x773 (#713, reserved attribute names as c-bind keys), #714 (out-of-date pages and the rolling-deploy check), #718 (one Rust URL scheme reader), and GHSA-7fjh (#722, reserved data-* names in Citry UI attribute maps). The two advisory records name the advisory and the affected and fixed versions; the facts come from the pull requests. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> * docs: link the #720 follow-up from the #714 review record Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Sonnet 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
On an HTML element, a
c-bindkey may no longer be one of the attribute names Citry uses to find its own elements and placeholders in the page:c-render-id,data-cid,data-citrydata-citry-key,data-citry-morph,data-citry-i18n,data-citry-i18n-bindingdata-cid-,data-ccss-,data-cev-,data-citry-css-,data-citry-omit-handler-,data-citry-opaque-,data-citry-runtime-,data-citry-security-,data-citry-vue-Before this change, a key taken from request data could, for example, put
c-render-id="<another component's id>"on an empty<template>, and the server join step copied that component's HTML into a second place on the page.The key raises
ValueErrorin any ASCII letter case, the same error type as the existing refusal foronclick,innerHTML,outerHTMLandsrcdoc. The message names the attribute, says why, and says how to fix it. The Events names (data-cev-*,data-citry-runtime-control,data-citry-runtime-events) anddata-citry-i18n-bindingon an i18n element keep theRuntimeErrorthey raise today, because their checks run first.One check,
reject_citry_marker_attr_nameincitry/attrs.py, runs everywherec-bindis applied to an element:$c-trbinding<c-element>: the component-tag spread and_resolve_element_attrsDeliberate scope
data-citry-*names that core Citry reads, not the whole prefix. Citry UI passes its owndata-citry-<component>-*names throughc-bind.<div data-cid-x>and<div c-c-render-id="...">. They never reach this check, and they are author input.<c-element>withc-isorc-bindrefuses these names even when the template writes them. It cannot tell a written name from data, the same as foronclick. This is the same code path as the existing handler refusal. A static<c-element is="div" data-cid-x>compiles to a plain element and is still accepted.on_attrs_resolvedhooks may still add these names. A hook is extension code, and the Events extension addsdata-cev-*this way.format_attrs()is unchanged; that question is Decide whether format_attrs refuses the names c-bind refuses #700, moved to 1.1.join_framesfill a placeholder only for the frame's own children. It stays listed in the trust-boundary doc's open questions.data-allow-mismatchis not refused. It is Vue's own public attribute. The trust-boundary doc now explains why it is left out.Compatibility
This refuses input that citry 0.9.0 accepted. That is allowed because 1.0.0 has not shipped, and the changelog lists it under "Upgrading from 0.9.x".
One existing test changed:
test_component_dynamic.pyexpected a writtendata-citry-keyon<c-element c-is>with#c-keyto fail with the metadata-conflict message. It now fails earlier, with the reserved-name message. The metadata-conflict check still runs after hooks, and a new test covers that.Docs
docs/design/trust_boundaries.md: updated the rows forc-bindkeys,<c-element>names, render ids and placeholders, and Citry UI attribute maps, and marked the Refuse Citry's own marker names in c-bind keys #699 open question decided. Thejoin_framespart stays open. Line references into the touched files were updated.docs_site/content/advanced/html-attributes.md: new "Names Citry reserves" section.docs_site/content/syntax/attributes.mdandadvanced/dynamic-components.md: short notes that link to that section.CHANGELOG.md: an upgrade note.Checks
pytestoverpackages/py/citry/testsandpackages/py/citry_ui/tests(not e2e, not qualification): 14714 passed. Two Citry UI tests fail, and they fail the same way onorigin/mainin the shared environment (test_distribution_metadata_and_resources_use_only_the_citry_ui_namespace,test_the_editor_accepts_digit_inputs_as_text_or_numbers).<c-element>static and dynamic, Vue, Vue-prepared,$c-trelement, Vue leaf rows)data-x,data-cidr,data-citry-ui-part, and non-ASCII lookalikesruff checkandruff format --checkpass.mypypasses for darwin and--platform linux.scripts/validate.pypasses.Independent review
A separate reviewer did a technical, security (Mechanism 7) and advisory-survey (Mechanism 8) pass. A docs cold reader did a prose pass.
Mechanism 7 result:
origin/main: ac-bindkeyc-render-idcopied another component's HTML, with and without Vue. It is closed on this branch.strsubclasses,UserDictandMappingProxyTypemappings, and Citry UIattrs=.Mechanism 8 result: the reviewer read the advisory survey and checked these classes:
xss-attrname,xss-spread,sanitizer-bypass,hydration,xss-dyntag,cache-xuser/deserialize, anddom-clobber. None is introduced.Findings fixed during the review:
on_attrs_resolvedhook on a Vue page, but not on a page without Vue. The check was removed, so hooks behave the same on both. A test now covers it.ERROR_CASESintest_simple_vue_row_caches.py, and a mutation check confirmed the new cases fail when those checks are removed.data-citry-runtime-*and fordata-citry-i18n-binding. Both corrected.Closes #699
🤖 Generated with Claude Code