rust: Add config-derived host barrier for XSS#375
Open
chanel-y wants to merge 1 commit into
Open
Conversation
Instead of a name-based barrier on config-looking struct fields, stop treating the `environment` threat model (e.g. std::env::var) as a source for the XSS query. Environment variables hold trusted deployment configuration set at startup, not per-request attacker input. This fixes the false positive where opts.server.external_domain (loaded from the EXTERNAL_DOMAIN env var) was flagged as XSS in an HTML response, without the fragility of matching on field names. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: bf9c111e-51cd-4c12-aeaa-cdcf1592f0f7
chanel-y
force-pushed
the
fix/rust-xss-fp
branch
from
July 23, 2026 21:46
b268ee1 to
3a8bf46
Compare
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.
Adds a barrier that blocks taint propagation through struct field accesses whose names match deployment configuration patterns (e.g., external_domain, hostname, base_url, server_url). These fields are typically set from environment variables or CLI options at startup, not from per-request input.
This addresses the false positive where opts.server.external_domain (loaded from EXTERNAL_DOMAIN env var) was incorrectly flagged as XSS in an HTML response.