The vulnerability 'HTTPS Content Available via HTTP' means that while your web application is using HTTPS to encrypt communication, it still allows users to access some resources via HTTP, which is not secure. This can be exploited by attackers to intercept sensitive data or carry out a man-in-the-middle attack.
The vulnerability 'HTTPS Content Available via HTTP' means that while your web application is using HTTPS to encrypt communication, it still allows users to access some resources via HTTP, which is not secure. This can be exploited by attackers to intercept sensitive data or carry out a man-in-the-middle attack. In this guide, we will provide a step-by-step manual on how to fix this vulnerability.
Step 1: Enable HTTPS on all pages of your web application
The first step is to ensure that your web application is entirely encrypted with HTTPS. To achieve this, you need to install an SSL certificate and configure your web server to redirect all HTTP requests to HTTPS. Here is an example of how to do this on Apache:
<VirtualHost *:80> ServerName example.com Redirect permanent / https://example.com/ </VirtualHost> <VirtualHost *:443> ServerName example.com SSLEngine On SSLCertificateFile /path/to/cert.pem SSLCertificateKeyFile /path/to/key.pem SSLCertificateChainFile /path/to/chain.pem # ... other configurations ... </VirtualHost>
Step 2: Fix Mixed Content errors
Mixed Content errors occur when some resources (such as images, scripts, or stylesheets) are loaded via HTTP while the rest of the page is encrypted with HTTPS. This can occur if the resources are hard-coded to use HTTP or if they are loaded from third-party sources that don't support HTTPS.
To fix Mixed Content errors, you need to ensure that all resources are loaded via HTTPS. Here are some steps to follow:
Content-Security-Policy: default-src https: 'unsafe-inline' 'unsafe-eval';By implementing these steps, you can eliminate all Mixed Content errors and ensure that all resources are loaded securely via HTTPS.
Step 3: Implement HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS) is a security policy that forces all communication between the client and the server to be encrypted with HTTPS. It achieves this by instructing the client's browser to only use HTTPS when communicating with the server, even if the user types in an HTTP URL or clicks on an HTTP link.
To implement HSTS, you need to add the following header to your web application's response:
Strict-Transport-Security: max-age=31536000; includeSubDomains
This header tells the client's browser to only use HTTPS for the next 31536000 seconds (one year) and to include subdomains as well. Here's an example of how to implement HSTS on Apache:
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"
By implementing HSTS, you can ensure that all communication between the client and the server is encrypted with HTTPS, providing an additional layer of security.
Step 4: Test your web application
After implementing the above steps, it's essential to test your web application to ensure that the vulnerability 'HTTPS Content Available via HTTP' has been fixed. Here are some tools you can use to test your web application:
Conclusion
The 'HTTPS Content Available via HTTP' vulnerability can be a severe threat to your web application's security. However, by following the steps outlined in this guide, you can fix this vulnerability and ensure that your web application is secure. It's essential to stay up to date with the latest security best practices and to test your web application regularly to ensure that it's secure.
Our expert VAPT identifies vulnerabilities in your web apps & network before attackers exploit them. Invest in peace of mind.