Skip to main content
MediumSSLOWASP A02:2021CWE-319

How to fix: Meta refresh sends visitors to a cleartext URL

An HTTPS page uses <meta http-equiv="refresh"> whose target URL is http://.

Why it matters

The browser leaves a TLS-protected page and lands on a plaintext one, carrying whatever the destination expects with it. Anything in the query string of that target, a session identifier, a one-time token, a return URL, is transmitted in the clear, and the destination page itself can be rewritten by anyone on the network path.

Meta refresh is often used as a fallback redirect on interstitial and logout pages, exactly the places that carry tokens, and the URL is usually hardcoded once and never revisited. A server-side 301 or 302 is better in every respect here: it happens before the document is parsed, it is honoured by clients that ignore meta refresh, and it is configured in one place where the scheme can be enforced.

How to fix it

  1. 1Change the target to https, or replace the meta refresh with a server-side 301/302.
  2. 2Check whether the redirect target is still correct at all; a hardcoded cleartext URL is usually a stale one.
  3. 3Add upgrade-insecure-requests to the CSP so a missed case is upgraded rather than sent in the clear.

Code examples

Server-side redirect instead

JavaScript
// Express
res.redirect(301, 'https://example.com/dashboard');

// Next.js Route Handler
return Response.redirect('https://example.com/dashboard', 301);

If meta refresh has to stay

HTML
<meta http-equiv="refresh" content="0; url=https://example.com/dashboard">

References

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

See every ssl check

Questions

How severe is Meta refresh sends visitors to a cleartext URL?
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-meta-refresh-http-target, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does Meta refresh sends visitors to 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 meta refresh sends visitors to 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

Meta refresh sends visitors to a cleartext URL | VulnRadar