From 1d93a8213a71a11b9451e0e7e5fd08806bc82622 Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Fri, 16 Oct 2026 10:49:25 -0500 Subject: [PATCH 1/5] Exempt inert schema-typed Liquid settings from LIQUID_UNSAFE_RENDER --- .../checks/LIQUID_UNSAFE_RENDER.md | 4 +- .../app-security-engine/checks/embedded.ts | 2 +- .../app-security-engine/rules/liquid-rules.ts | 71 ++++++++++++++++++- .../app-security-engine/scanners/index.ts | 2 +- .../tests/deterministic-rules.test.ts | 36 ++++++++++ 5 files changed, 110 insertions(+), 5 deletions(-) diff --git a/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md b/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md index a322754caea..d304e6765cc 100644 --- a/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md +++ b/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md @@ -1,6 +1,6 @@ --- id: LIQUID_UNSAFE_RENDER -version: 1 +version: 2 severity: medium precedence: union --- @@ -8,3 +8,5 @@ precedence: union # Liquid Unsafe Render Inspect only theme-extension Liquid/HTML files the parser could not analyze. Liquid output is not automatically HTML-escaped. Check the destination: use `escape`/`escape_once` for HTML text and ordinary attributes, `json` when embedding a value as JavaScript data, and `metafield_tag` only for supported rich metafield rendering in HTML content. HTML escaping is not sufficient for event handlers, `srcdoc`, or a `${select}`)).toContain('LIQUID_UNSAFE_RENDER') + expect(liquid(`
${select}`)).toContain('LIQUID_UNSAFE_RENDER') + expect(liquid(`x${select}`)).toContain('LIQUID_UNSAFE_RENDER') + // Missing or unparseable schema stays flagged. + expect(liquid('{{ block.settings.layout }}')).toContain('LIQUID_UNSAFE_RENDER') + expect(liquid('{{ block.settings.layout }}{% schema %}not-json{% endschema %}')).toContain('LIQUID_UNSAFE_RENDER') + }) }) From fb8c31f0bcf81bede1d964ca053eeb5d1cadebca Mon Sep 17 00:00:00 2001 From: Josh Larson Date: Tue, 20 Oct 2026 09:11:27 -0500 Subject: [PATCH 2/5] Limit LIQUID_UNSAFE_RENDER schema exemption to block settings with literal filter args In an app block, section.settings refers to the host section, so it is no longer checked against the block schema. Filter arguments are rendered too, so a filter argument that references a setting or variable (for example default: block.settings.title) now disqualifies the exemption. --- .../checks/LIQUID_UNSAFE_RENDER.md | 2 +- .../app-security-engine/checks/embedded.ts | 2 +- .../app-security-engine/rules/liquid-rules.ts | 41 ++++++++++++---- .../tests/deterministic-rules.test.ts | 47 ++++++++++++++++++- 4 files changed, 81 insertions(+), 11 deletions(-) diff --git a/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md b/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md index d304e6765cc..5430040b329 100644 --- a/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md +++ b/packages/app/src/cli/services/app-security-engine/checks/LIQUID_UNSAFE_RENDER.md @@ -9,4 +9,4 @@ precedence: union Inspect only theme-extension Liquid/HTML files the parser could not analyze. Liquid output is not automatically HTML-escaped. Check the destination: use `escape`/`escape_once` for HTML text and ordinary attributes, `json` when embedding a value as JavaScript data, and `metafield_tag` only for supported rich metafield rendering in HTML content. HTML escaping is not sufficient for event handlers, `srcdoc`, or a `