Skip to content

Secure Liquid authoring and rendered HTML in 3.x - #19819

Open
sebastienros wants to merge 5 commits into
release/3.0from
sebros/3x-sanitization-security
Open

Secure Liquid authoring and rendered HTML in 3.x#19819
sebastienros wants to merge 5 commits into
release/3.0from
sebros/3x-sanitization-security

Conversation

@sebastienros

Copy link
Copy Markdown
Member

Liquid-enabled HTML and Markdown currently mix trusted template authoring with ordinary content editing, while sanitization at persistence time can mutate source and leave existing records or alternate rendering paths exposed. This backports the 3.x-compatible security model while retaining Liquid, LiquidPart, and RenderLiquid behavior.

Changes

  • Adds the security-critical ManageLiquidTemplates permission, grants it to Administrator and Editor stereotypes, and migrates existing Editor roles without overwriting customized descriptions.
  • Enforces Liquid authorization server-side for LiquidPart, Templates, Admin Templates, preview, RenderLiquid definition settings, REST and MetaWeblog mutations, including recursively embedded content.
  • Preserves exact authored HTML and Markdown, then sanitizes final rendered output after Liquid, Markdown conversion, and shortcodes across display shapes, BodyAspect, and GraphQL.
  • Hardens HTML menu rendering by sanitizing a clone at the public MenuItemLink boundary and rejecting unsafe or malformed URL schemes without mutating persisted content.
  • Context-encodes editor source and JavaScript configuration while preserving round-tripping.
  • Adds focused permission, mutation, rendering-order, menu, persistence, sanitizer opt-out, and source-encoding coverage, plus canonical documentation updates.

This intentionally does not include the 4.0 removal of Liquid or LiquidField.

sebastienros and others added 2 commits September 1, 2026 12:16
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 907c1b33-a305-4d45-b5e6-a84f4e6d701d
sebastienros and others added 3 commits September 3, 2026 15:40
Set the expected UI culture explicitly so locale shortcode rendering does not depend on the CI runner's default culture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Send an explicit Accept-Language header so HTTP rendering uses the locale exercised by the assertions on runners with an invariant default culture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Continue verifying shortcode removal while keeping the Liquid and sanitization assertions independent of the runner's UI culture.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant