Skip to content

Review past security advisories of similar frameworks for gaps in Citry #259

Open

Description

@JuroOravec

In #253 and #256 we stopped trusting the emSign certificate authorities after a security incident at another company. Many security bugs repeat from project to project, so the advisories other frameworks have published can show where Citry might have the same bug before someone reports it.

docs/design/security-hardening.md plans a project-wide security audit that has not started yet. This issue adds one input to that audit: a list of real past advisories, each checked against Citry.

What to review

Past CVEs and GitHub security advisories from projects that solve the same problems as Citry:

  • Python templates and components: Django templates, Jinja2 (including its sandbox), django-components (Citry continues its component work).
  • Python expression sandboxes, which do the same job as Citry's safe_eval: RestrictedPython, simpleeval, asteval.
  • Vue and its ecosystem: Vue core, @vue/server-renderer, vue-i18n, Nuxt.
  • Other JavaScript frameworks with server rendering or server actions: React and Next.js (Server Components and server actions), SvelteKit.
  • Server-driven UI, closest to Citry Events: Phoenix LiveView, Laravel Livewire, Hotwire/Turbo, htmx.
  • Python frontend frameworks: Reflex, NiceGUI, Streamlit, Gradio, ReactPy, FastHTML, django-unicorn, Tetra.
  • Pyodide, which runs the docs playground.

To keep this bounded:

  • look at advisories from the last 5 years;
  • take at most about 10 per project, picked to cover different kinds of bug;
  • stop at about 80 advisories in total, or after about 2 working days.

Then report what was covered and what was left. You can skip an advisory whose cause cannot apply to Citry, such as a bug in a feature Citry lacks. Record each skip and the reason.

What to record for each advisory

  • what went wrong, in one or two sentences, with a link to the advisory;
  • which Citry part does the same job. Examples:
    • template escaping in the Rust compiler, safe_eval, and Vue server rendering;
    • Events requests, file uploads, CSRF, and CSP nonces;
    • JSON sent to the browser, and Secret values kept on the server;
    • i18n messages and html_transform;
    • asset, preview, and file routes, and caches;
    • the Django, Flask, FastAPI, ASGI, and WSGI integrations;
    • the language server and editor extensions, the playground, and release tooling;
  • whether Citry is not affected (and what prevents it), affected, or unknown;
  • for "not affected", the test that proves it, or a note that the test is still missing.

Deliverables

  1. A new file, docs/design/security_advisory_review.md, holding the table of reviewed advisories. Group them under the workstream names in section 3 of security-hardening.md (contextual output encoding, template and expression sandbox, HTTP and Events, and so on), and link the file from that doc's section 1.
  2. A regression test for each "not affected" bug class that has none yet, so a later change cannot bring the bug back. Where a test is large, a follow-up issue for it is enough.
  3. One public issue per gap that is safe to discuss, such as a missing size limit.

Anything that may be exploitable in a released Citry version stays out of the public table, this issue, and public PRs. That includes an "unknown" that might turn out exploitable. Report it through private vulnerability reporting, as SECURITY.md describes, and keep only a neutral placeholder row in the table.

Done when

  • each project above has its advisories classified, up to the limits, or a recorded reason for skipping it;
  • every row is marked not affected, affected, or unknown, and each "affected" or "unknown" row has a follow-up (a public issue or a private advisory);
  • each "not affected" bug class has a regression test or a follow-up issue for one.

🤖 Generated with Claude Code

Activity

  1. JuroOravec commented on Oct 25, 2026

    @JuroOravec
    MemberAuthor

    A review of published advisories in comparable projects (Vue and Nuxt server rendering, Jinja2 and MarkupSafe, Django templates, django-components, htmx, Alpine.js, and the Svelte, React and Angular template layers) was mapped to Citry's code, bug class by bug class. Classes checked by reading the code and found clear:

    • Cross-site request forgery in Events: Events JSON calls require Citry's own request header plus a same-origin Origin or Sec-Fetch-Site, and Django's CSRF middleware also applies there.
    • Regular-expression denial of service in the Python patterns that handle request input: anchored, with no nested or overlapping repetition.
    • Path traversal in asset serving: served names are cache keys, never joined to a filesystem path.
    • Prototype pollution in the browser state runtime: state lives in prototype-free objects and is copied with structuredClone.
    • Template text compiled at hydration: the browser uses Vue's runtime-only build, and data reaches it as JSON.
    • Injection through translation arguments: tr() accepts only plain value types and escapes them.
    • Secret leakage through browser data or cache keys: citry.Secret refuses both.

    A few areas need hands-on testing rather than code reading, and are being followed up. The missing request-size limits are tracked publicly in #404.

  2. added
    next-sprint
    on Oct 28, 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

    next-sprint

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions