Safari Redirect Handling Flaw Enabled Host Header XSS and Origin Confusion
Vulnerability Disclosure · 6 sources · Updated 3mo ago · First seen Oct 9, 2018

Apple patched CVE-2016-4585, a WebKit page-loading vulnerability in Safari that allowed remote attackers to inject arbitrary script or HTML through specially crafted HTTP redirections. The flaw affected Safari before 9.1.2, iOS before 9.3.3, and tvOS before 9.2.2, and stemmed from improper handling of redirect targets with malformed, non-numeric ports. Researchers showed Safari could send invalid Host headers after following such redirects, creating exploitable conditions in web applications that reflected the header into pages, scripts, links, forms, anchors, or subsequent Location values.
The research also described an origin confusion condition in which pages reached through the malformed redirect could execute in a broken security context. When combined with an iframe, relative resources from a target page could be resolved against an attacker-controlled site, enabling cross-site scripting, spoofing, information theft, and possible content exfiltration or alteration under specific application conditions. Apple addressed the issue by tightening redirect URL validation so invalid redirection URLs trigger an error instead of being processed.


