Angular SSR: The One-Slash Wonder (CVE-2026-27738)
Vulnerability ID: CVE-2026-27738
CVSS Score: 6.1
Published: 2026-02-25
A deceptively simple logic error in Angular's Server-Side Rendering (SSR) engine allows attackers to turn internal redirects into open redirects. By exploiting how the framework normalizes URLs from the X-Forwarded-Prefix header, a malicious actor can bypass validation with extra slashes, leading to protocol-relative URL redirection. This flaw affects major versions 19, 20, and 21, turning trusted applications into phishing launchpads.
TL;DR
Angular SSR's URL normalization logic only stripped a single leading slash from path segments. Attackers sending a X-Forwarded-Prefix: ///evil.com header can trick the server into generating a Location: //evil.com redirect. This protocol-relative URL forces the browser to navigate to the attacker's domain, enabling high-credibility phishing attacks.
⚠️ Exploit Status: POC
Technical Details
- CWE: CWE-601 (Open Redirect)
- CVSS v4.0: 6.9 (Medium)
- Attack Vector: Network (Header Manipulation)
- Exploit Maturity: Proof of Concept
- Privileges: None
- User Interaction: Required (Victim must click link)
Affected Systems
- Angular SSR 19.x < 19.2.21
- Angular SSR 20.x < 20.3.17
- Angular SSR 21.x < 21.1.5
-
@angular/ssr: >= 19.0.0-next.0, < 19.2.21 (Fixed in:
19.2.21) -
@angular/ssr: >= 20.0.0-next.0, < 20.3.17 (Fixed in:
20.3.17) -
@angular/ssr: >= 21.0.0-next.0, < 21.1.5 (Fixed in:
21.1.5)
Code Analysis
Commit: 877f017
fix(ssr): harden URL normalization and validate X-Forwarded-Prefix
while (start < end && part[start] === '/') { start++; }
Exploit Details
- GitHub: Original issue report containing PoC steps
Mitigation Strategies
- Upgrade to patched Angular SSR versions.
- Sanitize
X-Forwarded-Prefixheaders at the reverse proxy (Nginx/AWS ALB) level. - Implement middleware to strip multiple leading slashes from header values.
Remediation Steps:
- Identify if your application uses
@angular/ssrand is deployed behind a proxy passingX-Forwarded-Prefix. - Update
package.jsonto use@angular/ssrversion19.2.21,20.3.17, or21.1.5. - Run
npm updateoryarn upgrade. - Verify the fix by sending a request with
X-Forwarded-Prefix: ///testand ensuring the response location is/test(relative) orhttps://host/test(absolute), not//test.
References
Read the full report for CVE-2026-27738 on our website for more details including interactive diagrams and full exploit analysis.
Top comments (0)