I recently discovered that I had been serving .git on my blog for a couple of years. All it took to fix was a simple rule in my Nginx config: # Don't expose hidden files to the web location ~ /\. { return 404; }
Please stop serving .git to the outside world
11–20 of 91 posts
Re: Please stop serving .git to the outside world
#12I think there's nothing wrong with this if there aren't (and weren't) any secrets directly embedded in the source code and all configuration files that contain sensitive information are (and always were) properly gitignore'd. Tech-savvy users can even be encouraged to pull the code and send patches. :)
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Re: Please stop serving .git to the outside world
#13Earlier quoted context omitted.
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Why would it contain passwords?
Re: Please stop serving .git to the outside world
#14Earlier quoted context omitted.
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Why would it contain passwords?
Re: Please stop serving .git to the outside world
#15Earlier quoted context omitted.
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Why would it contain passwords?
Worse still, they could be using passwords in an external service (eg, for a database) and have included those as well.
Re: Please stop serving .git to the outside world
#16Earlier quoted context omitted.
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Why would it contain passwords?
//TODO replace password and username with user input
password = "johnsmithAdminpass1234"
username = "johnsmith01"
login(username, password)
If your test-DB is the same as your live one and username and password are real admin passwords, then you are in trouble. It's horrible and you shouldn't do this, but it happens.Edit: formatting
Re: Please stop serving .git to the outside world
#17Re: Please stop serving .git to the outside world
#18I make it a habit to put all my public files in directory such as www/, where as .git and other non public but site-related files/directories are contained above this.
Re: Please stop serving .git to the outside world
#19Earlier quoted context omitted.
Somebody correct me if I'm wrong here, but doesn't the .git directory essentially contain the entire history of the repository? The history could easily contain sensitive information like passwords. It will contain names email addresses of contributors, too. Try it yourself: cat .git/logs/HEAD
Why would it contain passwords?