1. Home
  2. Web App Vulnerabilities
  3. How to remediate – HTTPS Not Detected

How to remediate – HTTPS Not Detected

1. Introduction

HTTPS Not Detected is a vulnerability where websites do not use HTTPS, leaving data transmitted between users and the server unprotected. This matters because it allows attackers to intercept sensitive information like passwords and personal details. Systems affected are typically web servers and any applications handling user data over HTTP. A successful exploit could lead to loss of confidentiality, integrity, and availability of website data.

2. Technical Explanation

The technical root cause is the absence of a valid SSL/TLS certificate configured on the web server. This means communication happens in plain text instead of being encrypted. An attacker could use a man-in-the-middle attack to intercept and read data exchanged between the user’s browser and the website. The preconditions needed for exploitation are that the website is accessible over HTTP, and no redirection to HTTPS exists.

  • Root cause: Missing SSL/TLS certificate configuration on the web server.
  • Exploit mechanism: An attacker intercepts network traffic using tools like Wireshark or tcpdump while a user accesses the site over HTTP. They can then read sensitive data in plain text.
  • Scope: Web servers (Apache, Nginx, IIS) and applications handling unencrypted web traffic.

3. Detection and Assessment

To confirm if a system is vulnerable, check whether the website redirects to HTTPS or allows access over HTTP. A quick check involves visiting the site using both http:// and https:// URLs. For thorough assessment, use an SSL/TLS scanner.

  • Quick checks: Visit the website with both ‘http’ and ‘https’. If ‘http’ works without redirection, it’s vulnerable.
  • Scanning: Use tools like SSL Labs Server Test (https://www.ssllabs.com/ssltest/) to check for HTTPS configuration and certificate validity.
  • Logs and evidence: Check web server logs for requests served over HTTP. Look for missing TLS handshake events.
curl -I https://example.com

4. Solution / Remediation Steps

To fix the issue, enable HTTPS following best practices. This involves obtaining an SSL/TLS certificate and configuring the web server to use it. Only include steps that apply to this vulnerability.

4.1 Preparation

  • Ensure you have access to the web server’s configuration files and appropriate permissions. Roll back plan: Restore the original configuration files from backup.
  • A change window may be needed depending on the size of your website and potential impact. Approval from a security team might be required.

4.2 Implementation

  1. Step 1: Obtain an SSL/TLS certificate from a trusted Certificate Authority (CA). Let’s Encrypt (https://letsencrypt.org/) provides free certificates.
  2. Step 2: Configure your web server to use the SSL/TLS certificate. This typically involves editing the server configuration file (e.g., Apache’s httpd.conf or Nginx’s nginx.conf).
  3. Step 3: Redirect all HTTP traffic to HTTPS. Add a redirect rule in your web server configuration.
  4. Step 4: Restart the web server to apply the changes.

4.3 Config or Code Example

Before

# Apache configuration - no HTTPS configured
Listen 80
<VirtualHost *:80>
    ServerName example.com
    DocumentRoot /var/www/example.com
</VirtualHost>

After

# Apache configuration - HTTPS configured with redirect
Listen 80
<VirtualHost *:80>
    ServerName example.com
    Redirect permanent / https://example.com/
</VirtualHost>
Listen 443
<VirtualHost *:443>
    ServerName example.com
    DocumentRoot /var/www/example.com
    SSLEngine on
    SSLCertificateFile /path/to/your/certificate.pem
    SSLCertificateKeyFile /path/to/your/private.key
</VirtualHost>

4.4 Security Practices Relevant to This Vulnerability

Several security practices directly address this vulnerability type. Least privilege limits the impact if a server is compromised. Secure defaults ensure HTTPS is enabled by default. Patch cadence ensures timely updates for SSL/TLS libraries and certificates.

  • Practice 1: Least privilege to reduce potential damage from an attacker gaining access.
  • Practice 2: Input validation to prevent injection attacks that could bypass security measures.

4.5 Automation (Optional)

# Example Ansible task to ensure HTTPS redirection
- name: Ensure HTTP redirects to HTTPS
  ansible.builtin.lineinfile:
    path: /etc/apache2/sites-available/000-default.conf # Adjust path as needed
    regexp: '^Listen 80$'
    insertbefore: '^<VirtualHost *:80>'
    line: 'Redirect permanent / https://{{ ansible_fqdn }}/'

5. Verification / Validation

Confirm the fix by visiting the website using HTTPS and verifying that it redirects from HTTP to HTTPS. Re-run the earlier detection methods to confirm the issue is resolved. Perform a simple service smoke test to ensure functionality remains intact.

  • Post-fix check: Visit ‘http://example.com’ in your browser and verify automatic redirection to ‘https://example.com’.
  • Re-test: Use curl -I http://example.com and confirm the response code is 301 (Permanent Redirect).
  • Smoke test: Verify that key website features (e.g., login, search) work correctly over HTTPS.
curl -I http://example.com

6. Preventive Measures and Monitoring

Update security baselines to enforce HTTPS by default. Implement checks in CI/CD pipelines to prevent deployments without valid SSL/TLS certificates. Establish a regular patch or configuration review cycle for web servers.

  • Baselines: Update your security baseline to require HTTPS and automatic redirection.
  • Pipelines: Add SAST tools to scan code for hardcoded HTTP URLs.

7. Risks, Side Effects, and Roll Back

Potential risks include service downtime during configuration updates and compatibility issues with older browsers. Roll back by restoring the original web server configuration files from backup.

  • Risk or side effect 1: Service interruption if the SSL/TLS certificate is incorrectly configured. Mitigation: Test changes in a staging environment first.
  • Risk or side effect 2: Compatibility issues with very old browsers that do not support modern TLS versions. Mitigation: Monitor browser usage and consider supporting only current versions.
  • Roll back: Restore the original web server configuration files from backup, then restart the web service.

8.

Updated on December 27, 2025

Was this article helpful?

Related Articles