Does not redirect to a HTTPS site from HTTP port

Published on 05 Jun 2018
1 min read
Vulnerability
Client Side URL Redirect

This vulnerability is encountered when an application does not redirect to HTTPS of the same site. When this situation is encountered, it opens a whole new world for “Man in the middle” (MITM) attacks. It is necessary to implement HTTPS even if there is no sensitive data communication. HTTPS is required for viewing progressive web applications. HTTPS protects from attackers and legitimate intrusive companies (like ISP). Without HTTPS, an attacker can trick the end users into giving sensitive information to the attacker. He can even force the end users to install malware into the system. HTTPS stops attackers from passively listening to the communication.

Example

The following URL is an example of HTTP. The below URL is prone to MITM attacks.

http://example.beaglesecurity.com

The following URL is an example of HTTPS.

https://example.beaglesecurity.com

The following code is an example of this vulnerability.

        RewriteEngine On
        RewriteCond %{SERVER_PORT} 150
        RewriteRule ^(.*)$ http:www.example.beaglesecurity.com/$1 [R,L]

    

Impact

The following are the impacts of this vulnerability:-

  • Session hijacking attacks - An HTTP request that includes a session ID cookie is subject to session hijacking attacks. Session hijacking (or cookie hijacking) is exploitation of valid computer sessions. It is essential to allow HTTP redirect to HTTPS, that cookies are marked as secure.

  • Man-In-The-Middle (MITM) attack

Using this vulnerability, an attacker can:-

  • have access to all the unprotected information/data sent between the server and the clients.
  • passively listen to the communication to identify the end users. The identification includes name, location, interests and many more.

Mitigation / Precaution

Beagle recommends the following fixes:-

  • The application should redirect to HTTPS
        RewriteEngine On
        RewriteCond %{SERVER_PORT} 80
        RewriteRule ^(.*)$ https:www.beagleexample.com/$1 [R,L]

    
  • Make sure to clear the cache.
Manindar Mohan
Written by
Cyber Security Lead Engineer

Manieendar is a dedicated Security Engineer with a wealth of experience in the cybersecurity landscape. He plays a pivotal role at Beagle Security, where he employs his extensive knowledge to safeguard systems against cyber threats. Manieendar's passion for cybersecurity extends beyond his professional role; he actively contributes to the online security community through insightful articles and speaking engagements.

Experience the Beagle Security platform
Unlock one full penetration test and all Advanced plan features free for 14 days
4.8 on G2 • ISO 27001 certified
See How Beagle Security Works
No credit card • No setup required
Launch interactive demo