Repository navigation
Description
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, andjoin_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-*anddata-ccss-*: root markers and CSS-variable scoping markers.data-citry-vue-document,data-citry-vue-fragmentand otherdata-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
- Reserve
c-render-id,data-cid,data-ccss-anddata-citry-names in thec-bindpath, next to_reject_reserved_events_attr, on every producer (capture, leaf programs,<c-element>, i18n elements, Citry UI attribute maps). - Also have
join_framesaccept 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