High severityPHPHardcoded SecretsMEDIUM confidence
Basic Auth Credentials In URL
HTTP Basic-Auth credentials are embedded in a URL literal (scheme://user:pass@host) (CWE-798/CWE-522).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
$serviceUrl = "https://admin:[email protected]/v1";Passes - the safe pattern
$serviceUrl = "https://api.example.com/v1";Why it matters & how to fix it
HTTP Basic-Auth credentials are embedded in a URL literal (scheme://user:pass@host) (CWE-798/CWE-522). Credentials in URLs leak into logs, proxies, referrers, and browser history. Send credentials in an Authorization header sourced from configuration, not inline in the URL.
References
Rule ID integsec-php-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 SecretsBasic Auth Credentials In URL
- 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