Reject disallowed first-party proxy targets before signing - #1077
Open
ChristianPavilonis wants to merge 1 commit into
Open
Reject disallowed first-party proxy targets before signing#1077ChristianPavilonis wants to merge 1 commit into
ChristianPavilonis wants to merge 1 commit into
Conversation
ChristianPavilonis
requested review from
aram356 and
prk-Jr
and removed request for
aram356
August 26, 2026 20:04
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
/first-party/signwhen their parsed host does not matchproxy.allowed_domains, before expiry or signature work begins.403, while preserving the existing direct-load fallback for network errors, malformed responses, and other HTTP failures.Changes
crates/trusted-server-core/src/proxy.rscrates/trusted-server-core/src/error.rscrates/trusted-server-core/src/settings.rscrates/trusted-server-js/lib/src/integrations/creative/proxy_sign.tscrates/trusted-server-js/lib/src/integrations/creative/dynamic_src_guard.tscrates/trusted-server-js/lib/test/integrations/creative/proxy_sign.test.tscrates/trusted-server-js/lib/test/integrations/creative/image.test.tscrates/trusted-server-js/lib/test/integrations/creative/iframe.test.tsdocs/guide/api-reference.md403response, and the actual{ href, base }response shape.docs/guide/configuration.mddocs/guide/first-party-proxy.mdtrusted-server.example.tomlallowed_domainscomment to cover signing and fetching.CHANGELOG.mddocs/superpowers/specs/2026-08-26-first-party-sign-allowlist-enforcement-design.mddocs/superpowers/plans/2026-08-26-first-party-sign-allowlist-enforcement.mdScope
The change spans core signing policy, the creative browser runtime, regression tests, and maintained documentation because returning
403earlier would otherwise make the browser fall back to the rejected raw URL. It does not change adapters, routes, authentication, CORS, DNS or IP policy, token format, expiry, dependencies, or the configuration schema.Closes
Closes #1035
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axumcargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute servecargo test-cloudflare,cargo test-spin, parity tests, all target-specific Clippy gates, JavaScript build, documentation lint/build, andgit diff --checkChecklist
unwrap()in production code;expect("should ...")is used where applicableprintln!