Json Http Server Serves Insecure Http
Description
Detects when an HTTP server is configured without enforcing HTTPS, allowing insecure HTTP connections. This creates a security risk since communication between clients and the server could be intercepted or modified by attackers due to lack of encryption.
Detection Strategy
• Check server configuration objects or initialization parameters for HTTP server creation
• Look for missing or disabled HTTPS/TLS configuration flags and settings
• Verify if the server allows unencrypted HTTP connections without redirecting to HTTPS
• Report when HTTP server configurations lack secure HTTPS enforcement
Vulnerable code example
{
"name": "vulnerable-app",
"version": "1.0.0",
"scripts": {
"start": "http-server -p 8080 -a localhost" // Vulnerable: Binding to localhost can allow unauthorized local network access
}
}✅ Secure code example
{
"name": "secure-app",
"version": "1.0.0",
"scripts": {
"start": "http-server -p 8080 --ssl --cors -C cert.pem -K key.pem", // Secure: Uses HTTPS and CORS headers for protection
"start:local": "http-server -p 8080 -a 127.0.0.1 --ssl --cors" // Secure: Strictly local access with HTTPS
}
}Search for vulnerabilities in your apps for free with Fluid Attacks' automated security testing! Start your 21-day free trial and discover the benefits of the Continuous Hacking Essential plan. If you prefer the Advanced plan, which includes the expertise of Fluid Attacks' hacking team, fill out this contact form.