You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Check that nested-template attribute values are escaped on the node render path #702
On the node render path, is a nested-template attribute value on a plain HTML element escaped as attribute text?
What happens today
Ordinary renders format the rendered value with format_attrs, which escapes it; packages/py/citry/tests/test_nodes.py:215-231 locks that (body="<span>hi</span>").
The older node classes run only for templates that embed spans of another template language (foreign spans, the experimental host-template embedding, packages/py/citry/citry/component_render.py:3053-3062). There, the branch of ElementAttrsNode._format (packages/py/citry/citry/nodes/__init__.py:1513-1518) writes name=", then the rendered value as a child part, then ". No attribute escape is visible in that code. {{ }} values inside the nested template are still HTML-escaped, so request data cannot leave the attribute, but Markup, slot or child output that contains " might.
This was found by reading the code; nothing was run.
Next step
One test that renders c-title="<>...</>" on a template with a foreign span would settle it. If the value is not escaped, route it through format_attrs like the ordinary path.
Found while writing the trust-boundary design doc for #603.
Activity
fix: escape rendered markup in attributes on the node path (#702)
JuroOravec commentedon Nov 18, 2026
Fixed in citry 1.0.1 (commit 5d07a7d and the commit after it). The details are in GHSA-gv5c-rm2r-mvp5 and, for a Django
SafeString, GHSA-v7q5-qfrw-rhqc.