Skip to content

Refuse Citry's own marker names in c-bind keys #699

Closed

Description

@JuroOravec

The question

Should a c-bind key be able to write the attribute names that Citry itself reads as markers? Today it can.

What happens today

validate_html_attr_name (packages/py/citry/citry/attrs.py:425) checks only that a name is well formed. The reserved-name check _reject_reserved_events_attr (packages/py/citry/citry/nodes/__init__.py:155) covers data-cev-*, data-citry-runtime-control and data-citry-runtime-events. These names pass:

  • c-render-id: mark_html (crates/citry_html_transform/src/marker.rs) treats any empty <template c-render-id="..."> as a child placeholder, and join_frames (packages/py/citry/citry/serialize.py:964-975) puts the finished HTML of the frame with that id in its place. So <template c-bind="attrs">, with keys taken from request data, could copy another component's server HTML into a second spot on a static page.
  • data-cid-* and data-ccss-*: root markers and CSS-variable scoping markers.
  • data-citry-vue-document, data-citry-vue-fragment and other data-citry-* names, which Citry's browser code looks for.

Markup, <c-raw> and a template-written <template c-render-id> can write a placeholder too; those are author or app input, but join_frames does not check that the id belongs to one of the frame's own children.

No script execution was found. The effects found by reading the code are duplicated server HTML, CSS variables applied from another render, and a Vue app that refuses to start because it sees two data blocks. Nothing here was run.

CLAUDE.md Mechanism 7 says data must not be able to write one of Citry's markers, and docs_site/content/security.md expects c-bind keys from request data.

Options

  1. Reserve c-render-id, data-cid, data-ccss- and data-citry- names in the c-bind path, next to _reject_reserved_events_attr, on every producer (capture, leaf programs, <c-element>, i18n elements, Citry UI attribute maps).
  2. Also have join_frames accept a placeholder only for an id that is one of the frame's own children.

Found while writing the trust-boundary design doc for #603 (docs/design/trust_boundaries.md, "Open questions").

🤖 Generated with Claude Code

Activity

  1. added this to the 1.0.0 milestone on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions