How to fix: Link header preloads a cleartext subresource
An HTTPS response carries a Link header pointing a subresource relation at an http URL. The relation is one of preload, modulepreload, preconnect, prefetch, dns-prefetch, prerender or stylesheet.
Why it matters
The browser is told to fetch a resource over plain HTTP before the document has even been parsed. For a preloaded script or stylesheet that is active mixed content, so an on-path attacker who substitutes the response gets code execution on the origin. Browsers block active mixed content, which turns this into a hard load failure instead, so the page also breaks.
Header-delivered resource hints are easy to miss in a mixed-content review because nothing in the HTML shows them: they are usually added by a CDN, an edge worker, or a framework's early-hints support. That is also why they tend to hold stale absolute URLs from before the site moved to HTTPS. A protocol-relative or root-relative URL avoids the problem entirely.
How to fix it
- 1Change the Link header URLs to https, or to root-relative paths where the resource is same-origin.
- 2Check the CDN or edge configuration and any 103 Early Hints response, since those are the usual sources of a header-set hint.
- 3Add upgrade-insecure-requests to the CSP so a remaining cleartext hint is upgraded rather than blocked.
Code examples
Same-origin relative preload
Link: </assets/app.a91f2c.js>; rel=preload; as=script, </assets/app.a91f2c.css>; rel=preload; as=styleInspect the header
curl -sI https://example.com/ | grep -i '^link:'References
Detected automatically by VulnRadar. The check id is ssl-link-header-http-subresource, stable across every scan so you can filter or diff on it.
More ssl checks
- HighSecure Cookie Set on HTTP Endpoint
- CriticalSite Served Over Unencrypted HTTP
- InfoExpect-CT Header Not Present
- LowHTTPS Served on Non-Standard Port
- InfoX-HTTP-Method-Override / X-Forwarded-Method Header in Response
- InfoHSTS Present on HTTP Response (SSL-Strip Indicator)
- MediumMixed-Protocol Content (HTTPS Page Loading HTTP Resources)
- LowHSTS declared in a meta tag, where browsers ignore it
Questions
- How severe is Link header preloads a cleartext subresource?
- VulnRadar rates this medium severity in the ssl category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id ssl-link-header-http-subresource, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Link header preloads a cleartext subresource map to?
- It maps to CWE-319. In the OWASP Top 10 it falls under A02:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.