Insecure requests

Mixed content

A secure page loading something over http://. It is the least dramatic problem on this list and the one you most likely have, usually an image URL typed years ago into a CMS field nobody has opened since.

It is also the easiest first win in a report-only rollout. The reports are unambiguous, the fix is a one-line edit, and you can watch the issue stop appearing. Every control in client-side security goes in this way.

What mixed content is, and why it still matters

A page served over HTTPS that fetches a subresource over HTTP has mixed content. The padlock covers the document. Anything it loads insecurely travels in the clear, where anyone on the network path can read or change it.

For a script, whoever controls the path controls code that runs on your origin. Browsers now refuse insecure scripts, frames and network calls on a secure page outright. Images, audio and video are upgraded to HTTPS automatically and dropped if that fails.

That mostly solves it for the visitor, but the browser's own handling does not tell you. The image disappears, or it does not, depending on whether your CDN answers on HTTPS. A reporting policy finds the URLs before a visitor does.

What the report looks like

A source expression written https://cdn.example.com names a scheme as well as a host, so the same host over http:// does not match it. That mismatch produces this:

A legacy image URL on a product page, under a policy that allows the same CDN over HTTPS.
{
  "csp-report": {
    "document-uri": "https://shop.example.com/products/1421",
    "referrer": "https://shop.example.com/",
    "violated-directive": "img-src",
    "effective-directive": "img-src",
    "original-policy": "default-src 'self'; img-src 'self' https://cdn.example.com; report-uri https://k3x9mp2nq7ab.ingest.us.headerhawk.com/r",
    "disposition": "report",
    "blocked-uri": "http://cdn.example.com/legacy/size-guide.png",
    "status-code": 200,
    "script-sample": ""
  }
}

How it appears in HeaderHawk

img-src blocking cdn.example.com

  • blocked-uri carries the scheme: a host you allow, over a protocol you do not. Nothing else in the report is unusual, so this class is easy to triage.
  • The issue title says cdn.example.com with no scheme, because grouping is by directive and host. Open the issue and read the blocked URIs on its reports to see http:// against https://.
  • document-uri tells you where to edit. A handful of product pages is a content problem; every page on the site is a template or a stylesheet.
  • For an image, only report-only makes this visible. A report-only policy is checked against the URL as the page wrote it, before the browser's own upgrade, while an enforcing policy sees the upgraded request. Read the list before you enforce.
  • A policy carrying the legacy block-all-mixed-content directive reports under that name instead. That means the policy still has the old directive and upgrade-insecure-requests is absent, or the old one would have been inert.

Field by field: the img-src reference.

What HeaderHawk does with it

One bad URL in a shared template is thousands of reports a day and one row, with its report count, the number of pages it appeared on, and when it was first and last seen. Once you fix the URL, the last-seen time stops moving.

Opening the issue lists the reports: the exact pages, the full blocked URI with its scheme, the source file the browser attributed the request to, and the policy in force. For an image in a content field, the page list is usually enough to find every copy.

Extension and crawler traffic is classified as noise and kept out of alerts. Most of what an unfiltered endpoint on a public site receives comes from other people's browser extensions, and their mixed content is not your problem.

It is also the cheapest thing to try. The Free plan covers 1 site and 25,000 reports a month with no card, enough to point a policy at a site and see what it has.

Where CSP alone is not enough

CSP reporting finds the URLs your own policy objects to. It is not an audit of your site's transport security.

  • The browser's own mixed-content blocking sends no report. Browsers refuse insecure scripts, frames and network calls on a secure page with or without a CSP, and that refusal consults no directive. Your reports show what your policy refused, a smaller set.
  • upgrade-insecure-requests reports nothing, by design. It rewrites the request before it is made, so there is never a violation. It is the right fix for a large legacy codebase, and it also makes the problem invisible here, so make that trade knowingly.
  • The issue title groups by host, not by scheme. http:// and https:// on cdn.example.com share one issue, and the scheme is on the reports inside it.
  • A page nobody visits reports nothing. This is a live-traffic signal, not a scan, so a neglected corner of the site stays invisible until someone goes there.
  • It says nothing about navigations. A link to an http:// URL is not a subresource, no directive covers it, and upgrade-insecure-requests leaves third-party navigations alone too.
  • Reports cannot show whether you still send Strict-Transport-Security, or whether your policy is sent at all. On the Professional plan and above, each page you mark is fetched daily and a removed or changed header raises an alert. On the Free and Team plans, nothing here watches for either.
  • Report-only mode prevents nothing, and the fix is not here anyway. It is a URL in your markup, your CMS, or your CDN's rewrite rules.

Where to go next

  • upgrade-insecure-requests is the pragmatic fix for a codebase with too many URLs to find, and the reference explains why it emits no reports.
  • block-all-mixed-content is the deprecated directive you may still carry, and what to replace it with.
  • img-src covers the directive in the example, including the long tail of hosts that user content produces.

Start with one site, in report-only

Mixed content is what a report-only policy finds first, and the quickest thing here to fix and verify.