High severityJavaScript / TypeScriptHardcoded SecretsHIGH confidence
Basic Auth Credentials In URL
HTTP Basic-Auth credentials are embedded directly in a URL (https://user:password@host).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
const apiEndpoint = "https://svcuser:[email protected]/v1/data";Passes - the safe pattern
const safeEndpoint = "https://svcuser:${apiToken}@api.example.com/v1/data";Why it matters & how to fix it
HTTP Basic-Auth credentials are embedded directly in a URL (https://user:password@host). Credentials in URLs leak via logs, history, and referrers; pass them in an Authorization header sourced from a secret.
References
Rule ID integsec-js-basic-auth-credentials-in-url - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - Hardcoded SecretsDB Connection String With Credentials
- JavaScript / TypeScript - Hardcoded SecretsHardcoded Credential String
- JavaScript / TypeScript - Hardcoded SecretsHardcoded Crypto Key Or IV
- Python - Hardcoded SecretsBasic Auth Credentials In URL
- Python - Hardcoded SecretsDB Connection String Credentials
- Python - Hardcoded SecretsDjango Databases Password Literal