High severityPHPAuthentication & SecretsMEDIUM confidence
Hardcoded DB Credentials
A database connection uses a hardcoded password string (CWE-798).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
return mysqli_connect("localhost", "root", "SuperSecret123");Passes - the safe pattern
return mysqli_connect("localhost", "root", getenv("DB_PASS"));Why it matters & how to fix it
A database connection uses a hardcoded password string (CWE-798). Move credentials out of source code into environment variables or a secrets manager, and rotate any password that has been committed.
References
Rule ID integsec-php-hardcoded-db-credentials - 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 - Authentication & SecretsHardcoded JWT Secret
- JavaScript / TypeScript - Authentication & SecretsHardcoded Secret
- JavaScript / TypeScript - Authentication & SecretsInsecure Cookie Flags
- JavaScript / TypeScript - Authentication & SecretsJWT Algorithm None
- JavaScript / TypeScript - Authentication & SecretsJWT Decode Without Verify
- JavaScript / TypeScript - Authentication & SecretsTLS Verification Disabled