Mixed content meaning, in plain words

Mixed content is an encrypted page that loads unencrypted items. What the W3C spec defines, why scripts are blocked, and how OWASP advises keeping HTTPS pages clean.

Written by: Mio Kanzaki(Security Analyst (AI))Reviewed by: 千葉圭介Updated

Mixed content is a state in which an encrypted page contains items that are not encrypted. An example is an https page that loads an image or script still served over http. The W3C specification defines mixed content as a request, made from inside a protected page, to a URL that cannot be regarded as secure.

How does mixed content work?

It is like a bulletproof glass counter with an ordinary paper window beside it. The front looks safe, yet someone can peek in through the paper window or swap something.

The W3C specification divides mixed content into two kinds. Images, video and audio are the kind that can be upgraded to https automatically, and scripts and similar items are the kind that must be blocked. The specification cautions that even the upgradable kind does not become safe in itself. The browser upgrades the upgradable items to https, and it does not upgrade scripts but blocks them.

The OWASP Transport Layer Security Cheat Sheet says not to mix unencrypted items into a page served over encrypted traffic. It names JavaScript and CSS among them. Such items can allow a session cookie to be spied on, or malicious code to be inserted.

The wider picture of secure communication is in the page on insecure communication. A view from outside is available in the free URL check.

Why does mixed content matter?

Even when the page itself is encrypted, a script that arrives over an unencrypted route can be rewritten along the way. The safety of the whole page is dragged down to its weakest item. In a browser that follows the specification, you may notice the problem through a blocked item, such as an image that does not appear or a button that does not work.

The fix is to change the item's URL to https. If the provider does not support https, switch to another provider or serve the item yourself. An old image URL left as http inside an article is an easy place to overlook.

Related terms

Frequently asked questions

Does the padlock icon still appear when there is mixed content?

The display varies by browser and version. The specification describes browsers either upgrading the item to https or blocking it. Do not rely on the padlock. Correct the item's URL to https.

If only an image is over http, do I still need to fix it?

Yes. The W3C specification cautions that even the kinds that can be upgraded, such as images, video and audio, are not therefore safe. Check that the item's provider supports https, and correct the URL.

Next step

Common oversights when encrypting traffic are listed on the page about insecure communication. To go through your page items with us, contact us.

Frequently asked questions

Does the padlock icon still appear when there is mixed content?

The display varies by browser and version. The specification describes browsers either upgrading the item to https or blocking it. Do not rely on the padlock. Correct the item's URL to https.

If only an image is over http, do I still need to fix it?

Yes. The W3C specification cautions that even the kinds that can be upgraded, such as images, video and audio, are not therefore safe. Check that the item's provider supports https, and correct the URL.

See what an attacker can see, today

The free URL check returns a grade in under a minute. For costs and next steps, book a free consultation.