A company accidentally committed an .env file containing database credentials to a public GitHub repository. What is the immediate risk?
- A.The CI/CD pipeline may fail
- B.Anyone who finds the repository can extract the credentials and connect directly to the database, potentially reading or destroying all data
- C.The .env file will be automatically encrypted by GitHub
- D.Only developers with write access to the repo can see .env files
Why B is correct
Public GitHub repositories are indexed and scanned by bots within seconds of a push. Exposed credentials (database passwords, API keys, AWS access keys) are quickly abused. Immediate response: rotate the exposed secrets, revoke old ones, and use git-secrets or pre-commit hooks to prevent future leaks.
Know someone studying for Web App Fundamentals? Send them this one.