Skip to content

rust: Add config-derived host barrier for XSS#375

Open
chanel-y wants to merge 1 commit into
mainfrom
fix/rust-xss-fp
Open

rust: Add config-derived host barrier for XSS#375
chanel-y wants to merge 1 commit into
mainfrom
fix/rust-xss-fp

Conversation

@chanel-y

Copy link
Copy Markdown

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant