Allow static theme asset script URLs in app doctor - #8502
Open
francisbeaudoin wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavior change is narrowly scoped, includes targeted test coverage, and preserves detection for dynamic script URLs.
Pull request overview
Updates the App Doctor Liquid security scanning to avoid flagging <script src> tags that load a static theme asset URL (a quoted literal piped to asset_url), reducing false positives while still flagging dynamic/merchant-controlled script URLs.
Changes:
- Add a
isStaticScriptAssetUrlguard to skipUNSAFE_INNERHTMLfindings for<script src="{{ 'literal.js' | asset_url }}">. - Extend Liquid AST analysis tests to cover the static-asset allowance and keep dynamic
asset_urlcases flagged. - Add a patch changeset documenting the false-positive fix.
File summaries
| File | Description |
|---|---|
| packages/app/src/cli/services/app-doctor-engine/rules/liquid-rules.ts | Skips UNSAFE_INNERHTML for literal asset_url script src outputs to prevent false positives. |
| packages/app/src/cli/services/app-doctor-engine/tests/rule-analysis.test.ts | Adds coverage ensuring static asset_url script tags are allowed while dynamic ones remain flagged. |
| .changeset/quiet-assets-repair.md | Records the user-facing App Doctor false-positive fix as a patch release. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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
{{ 'chat.js' | asset_url }}.{{ block.settings.script | asset_url }}.Testing
pnpm vitest packages/app/src/cli/services/app-doctor-engine/tests/rule-analysis.test.ts --runpnpm eslint packages/app/src/cli/services/app-doctor-engine/rules/liquid-rules.ts packages/app/src/cli/services/app-doctor-engine/tests/rule-analysis.test.ts