High severityJavaScript / TypeScriptHardcoded SecretsHIGH confidence
DB Connection String With Credentials
A database connection string embeds inline credentials (protocol://user:password@host).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
const mongoUri = "mongodb://svcuser:[email protected]:27017/app";Passes - the safe pattern
const safeUri = "mongodb://svcuser:${dbPass}@db.internal.example.com:27017/app";Why it matters & how to fix it
A database connection string embeds inline credentials (protocol://user:password@host). Move the username/password to environment variables or a secrets manager and rotate the exposed credentials.
References
Rule ID integsec-js-db-connection-string-with-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 - Hardcoded SecretsBasic Auth Credentials In URL
- 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