Lenovo database of root user credentials exposed
A publicly reachable .git directory on a Lenovo subdomain allowed the author to dump the repository, and a config file inside it contained root database credentials along with database names and host details. An attacker could use those credentials to reach the database directly.
This is the blog about how I was able to retrieve the root user credential of .lenovo.com
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the .git directory was deployed to the production web root and only partly blocked, so its files could be downloaded and a config file with database credentials was exposed.
Impact
The exposed credentials could give an attacker root access to the database, and the dumped repository also revealed personal data, usernames and private addresses.
What the attacker needed
None
The fix
The .git directory should be removed from the production web root and access to it blocked at the server, and any exposed credentials should be rotated.
How it was found
- Find a subdomain endpoint where the .git path returns 403
- Request the .git/config file directly and see it return 200
- Dump the repository contents with a git dumping tool
- Review the dumped files and find a config file containing database credentials
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Websites sometimes keep a hidden folder called .git that stores the history of the site's code. If that folder is left readable on the live server, anyone can download the code and any secrets inside it. Here a settings file in that folder held the master password for the database, so the whole database could be opened.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.