Skip to content

Backend index tweak#5

Open
mayanksaini18 wants to merge 2 commits into
mainfrom
backend-index-tweak
Open

Backend index tweak#5
mayanksaini18 wants to merge 2 commits into
mainfrom
backend-index-tweak

Conversation

@mayanksaini18
Copy link
Copy Markdown
Owner

No description provided.

Desktop-synced iCloud creates copies like 'AGENTS 2.md' and
'next.config 2.ts' that keep landing in git status. Ignore the
pattern so they stop appearing.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lifeos Ready Ready Preview, Comment Apr 10, 2026 10:46am

Comment thread backend/src/index.js

const app = express();
connectDB();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 [critical] Hardcoded MongoDB connection string with embedded credentials

A MongoDB Atlas connection URI containing a username and password is hardcoded directly in source code and committed to the repository.

Why it matters: Anyone with read access to this repository can extract the database credentials and gain full access to the MongoDB cluster, potentially reading, modifying, or deleting all health tracker data.

Suggested fix:
Remove the hardcoded URI immediately. Store the connection string in an environment variable (e.g., MONGO_URI) and load it via process.env.MONGO_URI. Rotate the database password now, as it must be considered compromised. Add .env to .gitignore to prevent future leaks.

CodeGuard · security

Comment thread backend/src/index.js
const app = express();
connectDB();

const MONGO_URI = 'mongodb+srv://mayanksaini0416_db_user:%40Mayank0416@cluster0.v0rdlpc.mongodb.net/smart-health-tracker';
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 [critical] Credentials logged to console output

The hardcoded connection string (including username and password) is passed directly to console.log, meaning credentials will appear in any log aggregation system, CI output, or terminal history.

Why it matters: Credentials will be persisted in log files, monitoring dashboards, and CI/CD pipeline logs, dramatically widening the exposure surface beyond just the git history.

Suggested fix:
Remove the console.log statement entirely. If connection diagnostics are needed, log only a sanitized indicator such as console.log('MONGO_URI configured:', !!process.env.MONGO_URI).

CodeGuard · security

@github-actions
Copy link
Copy Markdown

codeguard Review · v0.1.0

🔴 Changes requested

Findings: 2 critical · 0 warning · 0 suggestion · 0 nit

Summary

This PR introduces a blank line but also exposes a hardcoded MongoDB Atlas connection URI containing plaintext credentials directly in source code, and then logs those credentials to the console. Both findings are critical security issues. The database password must be rotated immediately as it is now committed to git history and cannot be fully removed by a follow-up commit alone. The credentials should be moved to environment variables, the console.log removed, and the team should audit whether the repository is public or has been forked. This PR must not be merged.

Top findings

  1. [critical] backend/src/index.js:25 — Hardcoded MongoDB connection string with embedded credentials
  2. [critical] backend/src/index.js:26 — Credentials logged to console output

This review was generated by CodeGuard, a git-native AI PR reviewer.
CodeGuard is advisory only — humans always make the final merge decision.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant