Skip to content

Server-mode search results interpolate recipe names into innerHTML unescaped #487

Description

@dubadub

Found during review of #456. Pre-existing on main.

The inline search script in templates/base.html (server mode) renders results with ${recipe.path} and ${recipe.name} inside an innerHTML template literal without escaping. static/js/search.js (static mode) does escape via escapeHtml. A recipe name containing < breaks the row, and a name with markup is the stored-XSS shape if recipes are ever imported from the web.

Fix: reuse the same escaping helper in the inline script, or move server-mode rendering into search.js.

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions