Skip to content

security: database credentials hardcoded across multiple backend files #3

Description

@kazi716

Problem

Database credentials (host, user, password, database name) are
hardcoded directly in multiple backend files:

  • Backend/connection.php
  • Backend/login.php
  • Backend/signup.php
  • Backend/add_attendee.php

This means:

  • If the repo is ever made public with real credentials, they get exposed
  • Changing the database password requires editing every file separately
  • No .env protection

Suggested Fix

  • Create a single .env.example file for credential template
  • Update connection.php to read from environment variables
  • Make all other backend files use connection.php instead of
    hardcoding credentials separately
  • Add .env to .gitignore

Impact

Low risk currently (credentials are localhost defaults), but bad
practice that could cause real damage if deployed to production.

Would you like me to submit a PR with this fix?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions