Skip to main content
MediumSSLOWASP A02:2021CWE-319

How to fix: Mixed-Protocol Content (HTTPS Page Loading HTTP Resources)

Pages served over HTTPS include subresources (scripts, images, iframes, XHR) loaded over plain HTTP. Browsers block or warn on mixed content, and the HTTP subresources are vulnerable to MITM modification.

Why it matters

An attacker on the network can modify HTTP subresources in transit. A malicious script injected into an HTTP JS resource runs in the HTTPS page's origin, giving full access to session cookies and the DOM.

Mixed content occurs when an HTTPS page loads resources over HTTP. Modern browsers block active mixed content (scripts, iframes) and warn on passive mixed content (images). The HTTP resources are still vulnerable to MITM tampering regardless of the HTTPS page.

How to fix it

  1. 1Replace all http:// URLs in templates with https:// or protocol-relative //.
  2. 2Add a Content-Security-Policy header with upgrade-insecure-requests.
  3. 3Audit third-party widgets and ad tags for HTTP-only assets.

Code examples

CSP upgrade-insecure-requests

HTTP
Content-Security-Policy: upgrade-insecure-requests

Next.js (next.config.mjs)

JavaScript
const nextConfig = {
  async headers() {
    return [{
      source: '/(.*)',
      headers: [{ key: 'Content-Security-Policy', value: 'upgrade-insecure-requests' }],
    }];
  },
};
export default nextConfig;

References

Detected automatically by VulnRadar. The check id is mixed-protocol-content, stable across every scan so you can filter or diff on it.

See every ssl check

Questions

How severe is Mixed-Protocol Content (HTTPS Page Loading HTTP Resources)?
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 mixed-protocol-content, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Mixed-Protocol Content (HTTPS Page Loading HTTP Resources) 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 mixed-protocol content (https page loading http resources)

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

Mixed-Protocol Content (HTTPS Page Loading HTTP Resources) | VulnRadar