Repository navigation
fix: tighten cache replay, stylesheet writes, class names, attribute text - #759
Merged
Merged
Conversation
…text - On a render cache replay, check every binding ID in a text replacement that a payload extension stages, not only the ends of the marker. - Write a css_data() stylesheet into a configured cache again when the page is written, if the cache dropped it after the render. - Replay a cached component with a textarea and a dynamic value with its text. - Key the memo of pure component bodies by the body object, not its id(), so a reused id() cannot match another body. - Accept Django lazy translations as c-class names, and decode a Markup class or style dict key once. - Write a carriage return in an attribute value as in every Python attribute writer. - Warn with the findings when security_csp makes Citry send a Vue host empty. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED
Resolve the conflicts in CHANGELOG.md (main's Unreleased entries and this branch's entries now share one Fixes list) and in docs/design/trust_boundaries.md. Main's refreshed rows are kept; this branch adds its stage_render_cache() binding-id check and the security_csp warning for an empty Vue host. Line numbers that this branch's code changes moved (replay.py, serialization.py, attrs.py) are checked against the merged code. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED
This was referenced Nov 18, 2026
Resolves the conflicts in CHANGELOG.md and docs/design/trust_boundaries.md. The changelog keeps the entries from both sides. In the trust table, the message id row and the app id row take main's text about the own-key lookups, and the app id and $c-tr rows keep this branch's line numbers. Line numbers this branch cites in client.js and django.py move with the code main changed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED
JuroOravec
added a commit
that referenced
this pull request
Nov 18, 2026
) * docs(security): add review records for #754, #755, #756, #757 and #759 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED * docs(security): apply review findings to the 1.0.2 hardening records Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED --------- Co-authored-by: Claude Opus 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 changed
Seven small fixes in the render cache, the stylesheet store, class names
and attribute text. All are Python-only (
packages/py/citry).into stored HTML on replay. Citry now checks every binding ID in the
old and new values, not only the ends of the marker, and the values
must be exactly those IDs joined by single spaces. The built-in i18n
extension already writes this shape. Anything else makes Citry render
the component again instead of replaying it.
css_data()stylesheet with a configured cache. The stylesheetroute serves only what the cache holds. When the cache dropped the
entry after the render (a TTL, a size limit, or a replayed render that
never wrote it), the page linked a URL that answered 404. Citry now
writes each linked stylesheet again when it writes the page.
<textarea>. A cached component that writes a value intoa
<textarea>came back with an empty textarea on replay. Theserializer now gets the replayed leaf's stored parts, which still mark
the dynamic text.
pure = Truecomponents is keyedby the body object rather than its
id(), so a later body at a reusedaddress cannot match an earlier entry.
c-classandc-stylekeys. A Django lazy translation now worksas a class name (string, list item or dict key), and a
Markupclassor style dict key is decoded once, so
&is not escaped twice.escape_attribute_valuenowwrites a carriage return as
, because the browser reads a rawone as a line feed. The two leaf-program attribute writers (the row
formatter and the generated row writer) now call the same function.
security_cspon a Vue page. When the server HTML a Vue hostwould carry fails the CSP check, Citry sends the host empty. The
page's own CSP check then sees only the empty host, so nothing said
why. Citry now warns with what the check found, in
"warn"and"strict"mode alike. The render is not refused.docs/design/trust_boundaries.mdrows updated: theescape_attribute_valuebullet, thec-<name>value row, theclass/c-classrow, thesecurity_csprow, thecache/<class>.<hash>route row, and the payload render cache hook row. Line references into
the files this PR shifts are updated.
docs_site/content/vue/server-rendering.mdmentions the new warning.
Left out
still keeps a raw carriage return in an attribute value. It needs a
citry-corechange.css_data()stylesheet each timea page is written.
Checks
pytest packages/py/citry/tests(without e2e): 14,781 passed, 9skipped, 1 xfailed. 2 failures and 2 collection errors also happen on
mainin the same environment: an unpinned tzdata release, anunpinned pydantic release, and two files that import
citry_ui, whichwas not installed.
ruff checkandruff format --check(locked 0.14.13) on touchedfiles: clean.
mypy(locked 1.20.2) on touched source files, also with--platform linux: clean.Versioning
wire format changes.
replacement that 1.0.1 replayed.
stage_render_cache()isexperimental, its return type is not exported, and the render still
succeeds.
return, toward the value the app passed.
Review
An independent reviewer checked the change, with a security brief
covering text and markup, CSS, Citry's own markers, the responses Citry
serves, and the opt-in output checks. It found no security problem and
agreed this fits a patch release. Applied from its findings: the same
double-escape fix for
Markupstyle keys, updated line references intrust_boundaries.md, and a tighter textarea test assertion. A separateprose pass reworded the changelog entries, the warning text (it now says
what to do), comments and docstrings.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KUhrHXH1mNfRCnPcsQt7ED