security: validate PERCY_SERVER_ADDRESS to loopback (PER-8681, PER-8682)#1165
Open
Shivanshu-07 wants to merge 1 commit into
Open
security: validate PERCY_SERVER_ADDRESS to loopback (PER-8681, PER-8682)#1165Shivanshu-07 wants to merge 1 commit into
Shivanshu-07 wants to merge 1 commit into
Conversation
PER-8681 (CWE-918) — PERCY_SERVER_ADDRESS was assigned to utils.percy.address with no validation, so an attacker who can set it could redirect all outbound SDK HTTP (healthcheck, snapshot upload) to an arbitrary/internal host. PER-8682 (CWE-94) — percySnapshot eval()s the @percy/dom bundle returned by utils.fetchPercyDOM(), which is fetched from utils.percy.address. With an unvalidated address that eval becomes remote code execution in the test browser. Both share one root: the address. Validate PERCY_SERVER_ADDRESS resolves to a loopback host (localhost/127.0.0.1/::1) before assigning it; otherwise warn and fall back to the @percy/sdk-utils default. The eval now only ever runs code served by the local Percy CLI. (eval itself is the standard PercyDOM-injection mechanism shared by all Percy SDKs and is left in place, now sourced safely.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
prklm10
approved these changes
Jun 26, 2026
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.
Summary
Resolves the two runtime component findings behind the percy-ember chains (deadline 2026-06-21).
PERCY_SERVER_ADDRESSinjected verbatim controls all outbound HTTP targetsevalof network-fetched JS executes arbitrary code in the test browserRoot cause (shared)
addon-test-support/@percy/ember/index.jssetutils.percy.address = SDKENV.PERCY_SERVER_ADDRESSwith no validation.percySnapshottheneval()s the@percy/dombundle returned byutils.fetchPercyDOM()— which is fetched from that address. So an attacker-controlled address both redirects all SDK traffic (SSRF) and turns theevalinto RCE in the test browser.Fix
Validate
PERCY_SERVER_ADDRESSresolves to a loopback host (localhost/127.0.0.1/::1) before assigning it; otherwise warn and fall back to the@percy/sdk-utilsdefault. Theevalnow only ever executes code served by the local Percy CLI.The
evalitself is the standard PercyDOM-injection mechanism shared by every Percy SDK and is left in place — this PR secures its source, which is the exploitable part. Documented inline.Verification
evil.example,169.254.169.254rejected).node --checkpasses.Closes PER-8681, PER-8682. Together with the CI hardening (#1164) this severs the percy-ember supply-chain → runtime chains (PER-8691/8692/8693).
🤖 Generated with Claude Code