Skip to content

Remove hardcoded credentials from db-reset.js - #123

Open
legit-app-ci[bot] wants to merge 1 commit into
masterfrom
agentic-appsec/sast-rem/7fb6ed54-8316-40b0-8a2f-43aa4f11bab8
Open

Remove hardcoded credentials from db-reset.js#123
legit-app-ci[bot] wants to merge 1 commit into
masterfrom
agentic-appsec/sast-rem/7fb6ed54-8316-40b0-8a2f-43aa4f11bab8

Conversation

@legit-app-ci

@legit-app-ci legit-app-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown

Summary

Fixes Password hashes should not be disclosed in artifacts/db-reset.js (lines 7–67).

The database reset script contained hardcoded plaintext passwords ("Admin_123", "User1_123", "User2_123") and commented-out bcrypt hashes committed to source control, exposing credentials to anyone with repository access.

Changes

  • Removed all commented-out password hash lines
  • Replaced plaintext password strings with environment variable lookups: process.env.ADMIN_PASSWORD, process.env.USER1_PASSWORD, process.env.USER2_PASSWORD
  • Added validation to fail fast with a clear error message if required environment variables (ADMIN_PASSWORD, USER1_PASSWORD, USER2_PASSWORD) are missing
  • Updated the file header comment to document required environment variables and provide usage example

Credentials must now be provided via environment variables at runtime and are no longer committed to version control.

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants