Skip to main content
LowSSLOWASP A02:2021CWE-319

How to fix: Resource hint on an HTTPS page targets a cleartext URL

An HTTPS page contains a link element resource hint whose href is a cleartext http URL. The relation is one of preload, modulepreload, preconnect, prefetch, dns-prefetch, prerender or manifest.

Why it matters

preconnect and dns-prefetch to an http:// origin leak the destination hostname to the network before any content is requested, and warm a connection the browser then cannot use. preload and modulepreload of an http:// script or style are active mixed content, so the fetch is blocked and whatever depended on it fails. A cleartext manifest link means the installed web app's own metadata can be rewritten in transit.

Separate from the classic mixed-content checks, which read src on media and script elements and href on stylesheet links: hint relations are a different set of rel values and are usually added by a performance pass rather than by the code that renders the resource. That is why they lag behind an HTTPS migration. The risk varies by relation, hence the Low rating, but every case is either a leak or a broken fetch.

How to fix it

  1. 1Rewrite the href values to https, or to root-relative paths for same-origin resources.
  2. 2Delete hints that point at hosts the page no longer uses, which is common after a CDN change.
  3. 3Add upgrade-insecure-requests to the CSP as a safety net.

Code examples

Hints over HTTPS

HTML
<link rel="preconnect" href="https://cdn.example.com" crossorigin>
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
<link rel="manifest" href="/site.webmanifest">

Find cleartext hints in a template tree

bash
grep -rn 'rel="\(preload\|preconnect\|prefetch\|dns-prefetch\|manifest\)"' \
  --include='*.html' . | grep 'http://'

References

Detected automatically by VulnRadar. The check id is ssl-http-resource-hint-tag, stable across every scan so you can filter or diff on it.

See every ssl check

Questions

How severe is Resource hint on an HTTPS page targets a cleartext URL?
VulnRadar rates this low 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-http-resource-hint-tag, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Resource hint on an HTTPS page targets a cleartext URL 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.

Propose a checkHow a check is built

Scan your own site for resource hint on an https page targets a cleartext url

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

Resource hint on an HTTPS page targets a cleartext URL | VulnRadar