How to fix: Hardcoded HTTP URL in Application
A hardcoded http:// URL (non-localhost) was found in the response body, indicating the application may make insecure connections to external services or load resources over plaintext HTTP.
Why it matters
HTTP traffic is unencrypted and susceptible to man-in-the-middle attacks, content injection, and eavesdropping. Browsers block mixed content (HTTP resources on HTTPS pages) which also causes silent failures.
AI-generated code frequently hardcodes http:// URLs from examples or documentation. While localhost is fine over HTTP, production service URLs, CDN assets, and API endpoints must use HTTPS.
How to fix it
- 1Replace all hardcoded http:// URLs with https://.
- 2Use environment variables for all external URLs so they can be configured per environment.
- 3Add a CSP upgrade-insecure-requests directive to automatically upgrade HTTP to HTTPS in the browser.
- 4Configure your server to redirect HTTP to HTTPS permanently (301).
Code examples
Use environment variables for URLs
// Bad (AI-generated)
const apiUrl = 'http://api.example.com/v1';
// Good
const apiUrl = process.env.API_URL; // Set to https://... in all environmentsReferences
Detected automatically by VulnRadar. The check id is vibe-http-not-https, stable across every scan so you can filter or diff on it.
More ai code checks
- LowGeneric Error Messages Leak No Context
- MediumTODO/FIXME Security Note in Response
- Higheval() Usage in Page Scripts
- HighSSL Certificate Verification Disabled
- HighMath.random() Used for Security Tokens
- CriticalHardcoded Credential in Authentication Logic
- CriticalJWT 'none' Algorithm Accepted
- CriticalSQL String Concatenation Pattern Detected
Questions
- How severe is Hardcoded HTTP URL in Application?
- VulnRadar rates this medium severity in the ai code category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id vibe-http-not-https, which stays the same between runs so you can filter, diff, or gate CI on it.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.