High severityC#Authentication & SecretsHIGH confidence
Connection String With Password
A database connection string with an embedded password appears hard-coded in source (CWE-798).
Standards mapping
- OWASP ASVS
- V6.4.1 (L2)V2.10.4 (L2)
Vulnerable vs. safe
Flagged by this check
var connStr = "Server=db;Database=app;User Id=sa;Password=P@ssw0rd";Passes - the safe pattern
var connStr = "Server=db;Database=app;Integrated Security=true;";Why it matters & how to fix it
A database connection string with an embedded password appears hard-coded in source (CWE-798). Move the connection string to protected configuration (user-secrets in development, Key Vault/environment in production) and prefer integrated/managed identity authentication so no password is stored at all.
References
Rule ID integsec.csharp.auth.connectionstring-with-password - 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