A company accidentally committed an .env file containing database credentials to a public GitHub repository. What is the immediate risk?
- A.Anyone who finds the repository can extract the credentials and connect directly to the database, potentially reading or destroying all data
- B.The credentials stay visible in the commit history to all forks, and the attacker needs the database host name from a separate source, a barrier that applies to every setup
- C.Search engines index the file name only, and the risk is a policy notice from GitHub to the owner
- D.GitHub deletes the file all at once after the push, and attackers lose access within seconds, a fix that needs no rotation
Why A 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.