fix(security): resolve playwright goto-injection findings in JS template (INF-1647)#154
Open
cyrusagent[bot] wants to merge 1 commit into
Open
Conversation
…te (INF-1647) The page.goto(sessionUrl) call in the JS scaffold template flows from developer-provided constants (WEBSITE_URL_1/2/3) set at scaffold time, never runtime/untrusted input. Add a scoped nosemgrep suppression with rationale documenting the template-time decision.
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.
Assignee: @KateZhang98 (kate)
Summary
Resolves the Semgrep
javascript.playwright.security.audit.playwright-goto-injectionfinding(s) in.templates/js/template.js.Decision: template-time, developer-provided URL
The
page.goto(sessionUrl)call in this scaffold template receives its URL from top-level constants (WEBSITE_URL_1/2/3) that a developer hard-codes when generating a script. There is no runtime or untrusted input path — the values are developer-supplied scaffold input, not attacker-controllable. This matches the case the SAST hand-off explicitly endorses for a scoped suppression.A custom allowlist/scheme guard was considered but rejected: the
autoruleset would not recognize a custom validator as a sanitizer, so the finding would persist regardless, and it would add noise to a scaffold whose URLs are static placeholders.Change
Added a scoped, documented suppression on the single offending call site:
The original scan (2026-05-06) reported 7 findings; these were Semgrep's taint paths tracing the 3 placeholder constants through
Promise.all→fetchDatainto the singlepage.goto. The repo currently has one call site, which this suppresses.Verification
Semgrep is not installed in the agent runtime, so the scan could not be executed locally. The suppression uses the exact rule ID in the standard preceding-line
nosemgrepform, which clears the finding. CI / a localsemgrep scan --config=autoshould now exit0for this file.Closes INF-1647