Launch weekSIGSHIP is on Product Hunt and LiftOff. 50% off every plan with code LAUNCH50 until Sunday 6 December (Solo monthly has its own founder offer): Pro is $74.50 and Business $249.50, paid once.Launch week: 50% off · LAUNCH50See plans →Plans →
  1. Home
  2. The 30 checks
  3. A database password is written in the code
🔑 Keys & passwords · Fix now (SEV-1)

A database password is written in the code 

In plain English: Your code contains a database address with the password written inside it, such as postgresql://user:password@host. Anyone who can read the code can connect to your database directly and read or delete everything, skipping every check your app makes.

What happens if you ship it

Anyone who reads the repo can connect straight to your database and read or delete everything, past every check your app makes.

How to fix it technical

Change the database password now. Read the connection string from an environment variable such as DATABASE_URL in server code, and remove it from the code.

Let your AI tool fix it

Paste this into Lovable, Bolt, Cursor, Replit or Claude Code:

Prompt for your AI tool
Fix this problem in my project: A database password is written in the code. Change the database password now. Read the connection string from an environment variable such as DATABASE_URL in server code, and remove it from the code. Change only what this fix needs, then tell me what you changed and anything I have to do myself.

Check your app

Run npx sigship in your project folder. It reports this problem as db-password-in-code, along with 29 other checks. Nothing leaves your computer. New to the terminal?

Questions

Where should the connection string go instead?

In an environment variable, usually DATABASE_URL, set in your host's dashboard and read only by server code. Keep it out of the code and out of git.

Is a database on my own computer a problem?

No. Addresses like localhost, or a docker compose service such as db, are only reachable from your machine, so SIGSHIP leaves them alone.

Do I need to change the password?

Yes. Once it has been in the code, assume someone has it. Change it in your database provider's dashboard, then update the environment variable.

See every check · Jargon, explained