Missing HTTP to HTTPS Redirect: Preventing Cleartext Traffic Interception
The HTTP protocol transmits network packets without encryption. If a site is accessible via HTTP without an immediate 301 redirect to HTTPS, data travels in cleartext.
Attackers on public Wi-Fi networks can intercept unencrypted session cookies, passwords, and inject malicious scripts into web pages (Man-in-the-Middle attacks).
Vulnerability Risk & Threat Impact
Cleartext interception of authentication credentials and degraded search engine rankings across Google and Yandex.
How Our Scanner Inspects for This Flaw
Site Check queries port 80 over HTTP and confirms whether an immediate permanent redirect (301 Moved Permanently) to HTTPS is enforced.
Diagnostics of transport security and HTTP response policies parse security headers returned by the origin server. The scanner checks for Content-Security-Policy, Strict-Transport-Security, X-Frame-Options, and robust cookie protection attributes (HttpOnly, Secure, SameSite).
Remediation Guide (Step-by-Step Fix)
To resolve this vulnerability, apply the following configuration or code snippet to your web server:
# Force permanent 301 redirection from HTTP to HTTPS in Nginx:
server {
listen 80;
server_name your-domain.com www.your-domain.com;
return 301 https://$host$request_uri;
}
- Configure a permanent 301 redirect from HTTP to HTTPS for all domains and subdomains.
- Enable HSTS (Strict-Transport-Security) to prevent protocol downgrade attacks.
Attack Anatomy & Real-World Business Impact
Plaintext HTTP endpoints enable Man-in-the-Middle (MitM) eavesdropping and SSL-stripping attacks on shared networks, exposing session cookies and authentication payloads.
Compliance Framework Impact: Violation of fundamental security controls specified in OWASP Top 10 (A05:2021 Security Misconfiguration), SOC 2 Type II trust criteria, and ISO 27001 Annex A.
Defense-in-Depth Engineering Matrix
| Defense Layer | Technical Action | Tool / Enforcement |
|---|---|---|
| Edge Perimeter & Ingress Gateway | Enforce granular path restrictions and deny rules for routes matching http-to-https-redirect | Nginx Ingress Directives |
| Application Runtime Hardening | Disable verbose runtime telemetry and enforce least privilege controls for http-to-https-redirect | Runtime Configuration Hardening |
| CI/CD DevSecOps Automation | Incorporate automated verification gates for http-to-https-redirect within continuous deployment pipelines | Site Check Security Scanner |
CLI Remediation Verification: Terminal Commands
After applying configuration changes or patching source code, verify that the exposure is neutralized using command-line diagnostic tools:
curl -I -s http://your-domain.com/ | grep "Location:"
# Must return a 301 redirect to https://
DevSecOps Best Practices & CI/CD Hardening
Implement port 80 return 301 https://$host$request_uri; rules in Nginx and configure HSTS with preload directives.
Frequently Asked Remediation Questions
Properly configured security headers establish browser-enforced defense-in-depth for all visitors. The absence of modern CSP and HSTS leaves client sessions susceptible to Clickjacking, protocol downgrade eavesdropping, and MIME-type confusion attacks.
To permanently close the «Missing HTTP to HTTPS Redirect: Preventing Cleartext Traffic Interception» threat vector, integrate verification gates into your CI/CD pipeline and maintain automated perimeter checks with Site Check.