Summary
A URL validation mismatch in Angular's server-side rendering pipeline allows remote attackers to bypass host allowlist checks and pivot server-side HTTP requests to arbitrary external endpoints.
By crafting malformed URLs that are rejected by strict validation but later accepted by a lenient DOM parser, an attacker can steer backend SSR requests toward attacker-controlled hosts, enabling powerful SSRF scenarios.
Affected context
This vulnerability affects applications using Angular's @angular/platform-server for server-side rendering (SSR) where outbound HTTP calls are made during rendering and constrained by a host allowlist.
It becomes relevant when SSR relies on URL-based checks using Node's strict URL parsing (URL.canParse) for validation, while the emulated DOM environment uses Domino's more lenient URL parser to establish the origin for relative HTTP requests.
In environments where SSR has network access to internal services, metadata endpoints, or privileged APIs, malformed URLs can cause the SSR engine to treat an attacker-controlled host as the origin for subsequent backend requests.
Exploit preconditions
- Attack surface: Server-side rendering endpoints that accept or derive URLs (e.g., request URLs, headers, configuration values) which influence SSR-origin or backend request resolution.
- Required access: Ability for a remote client to supply or influence a URL used in the SSR pipeline (typically via HTTP requests to the SSR endpoint).
- Trigger point: Submission of a specially crafted malformed URL (such as
http://evil.com:80:80/path) that fails strict validation by Node's URL parser and therefore skips the host allowlist. - Why exploitation is possible: The strict parser rejects malformed URLs and bypasses host validation, while the lenient Domino parser later accepts the same URL and sets
evil.com:80as the origin; Angular's SSR interceptor (relativeUrlsTransformerInterceptorFn) then resolves relative backend HTTP requests against this origin, turning them into attacker-directed SSRF calls.
Why this happens
The underlying bug stems from a parser differential between two URL handling components within the SSR pipeline.
Host allowlist validation relies on Node's strict WHATWG URL implementation (URL.canParse), which refuses certain malformed URLs and consequently skips validation when parsing fails.
Later in the same request flow, the emulated DOM environment powered by Domino uses a more permissive URL parser that accepts the malformed input and assigns an origin based on it.
This mismatch creates a trust gap: input that is considered invalid (and thus unvalidated) by one component is treated as valid by another, enabling untrusted data to influence outbound HTTP request destinations.
This pattern aligns with CWE-918 (Server-Side Request Forgery) driven by incomplete URL validation, and CWE-346 (Origin Validation Error) where origin checks are undermined by inconsistent parsing logic.
Potential impact
- Server-side requests may be redirected to attacker-controlled domains.
- SSRF attacks could reach internal network services not directly exposed to the internet.
- Access to cloud metadata services or administrative APIs could be possible, enabling credential theft or environment compromise.
- Outbound calls to sensitive microservices may lead to data leakage or unintended state changes.
- Logging and monitoring systems may be polluted with attacker-driven traffic patterns and misleading origins.
General mitigation guidance
Effective mitigation focuses on consistent URL validation and strict control of outbound SSR-origin behavior.
Common defensive patterns include:
- Using a single, authoritative URL parsing and validation mechanism across all layers (SSR origin, allowlist checks, HTTP interceptors) to avoid parser differentials.
- Treating any URL that fails strict parsing as rejected, rather than skipping validation; enforce explicit failure paths for malformed inputs.
- Restricting SSR-origin determination to trusted configuration only, avoiding any direct origin derivation from client-supplied data.
- Applying network-layer defenses, such as egress filters and firewall rules, so SSR processes can only reach explicitly approved hosts and services.
- Adopting least-privilege principles for SSR runtime environments, limiting their ability to access internal or high-value endpoints even if origin validation fails.
How teams detect issues like this
Organizations can detect and manage this class of issue through:
- Static analysis rules that flag multiple URL parsing libraries or code paths used for validation and origin resolution, especially when they differ in strictness.
- Code reviews focusing on SSR frameworks, HTTP interceptors, and host allowlist implementations to ensure that origin and target URL validation are coherent and centralized.
- Security tests and fuzzing of SSR endpoints with malformed URLs (e.g., multiple ports, illegal characters) to observe whether host validation is unexpectedly bypassed.
- Runtime monitoring and logging of outbound SSR requests, with alerts for calls to unapproved domains or unusual URL patterns.
- Policy enforcement in CI/CD pipelines to require documented allowlist checks and consistent parsing strategies for SSR-related code.

