400,000 Websites Vulnerable Through Exposed .git Directories (scmagazine.com)
Open .git directories are a bigger cybersecurity problem than many might imagine, at least according to a Czech security researcher who discovered almost 400,000 web pages with an open .git directory possibly exposing a wide variety of data. From a report: Vladimir Smitka began his .git directory odyssey in July when he began looking at Czech websites to find how many were improperly configured and allow access to their .git folders within the file versions repository. Open .git directories are a particularly dangerous issue, he said, because they can contain a great deal of sensitive information. "Information about the website's structure, and sometimes you can get very sensitive data such as database passwords, API keys, development IDE settings, and so on. However, this data shouldn't be stored in the repository, but in previous scans of various security issues, I have found many developers that do not follow these best practices," Smitka wrote. Smitka queried 230 million websites to discover the 390,000 allowing access to their .git directories. The vast majority of the websites with open directories had a .com TLD with .net, .de, .org and uk comprising most of the others.
# protect git directories /\.git
RedirectMatch 404
https://slashdot.org/.git
Yeah, I was surprised...
... belongs behind ssh or, at least, behind http access and SSL.
If I catch you doing otherwise for anything other than FOSS software I'll smack you. Hard.
We suffer more in our imagination than in reality. - Seneca
I use visual source safe so I don't have to worry about .git files.
just an article from 2015 https://en.internetwache.org/d...
I can give you also next year's article about .file vulnerabilities. (spoiler alert) https://en.internetwache.org/s...
copy/paste from source to target, or even worse directly edit in the target
Thats what you get on hiring those bootcamp "graduates"
Thats what you get on hiring those bootcamp "graduates"
Kode w/ Karlie Kloss, like it or not.
for g in $(grep '.git$' mylist.txt) ; do git clone $g ; done
230 million websites. 400k poorly configured. 4*10^5/2.3*10^8 is less than 0.2% of websites surveyed screwed this up.
400k is a big number but it's good to know most developers aren't that stupid on this issue.
who pushes their .git to production?
An open git directory will be everything you need to reconstruct the site, more often than not from the same server you're targeting. Scary. Database servers are rarely open. Short of some serious hacking, there isn't a lot you're going to be able to do with this stuff once you've obtained the information you're waving around here.
Until such time as I see hackers actually logging in with this information and defacing github, I'm going to remain unconvinced of the severity of this one.
This signature has Super Cow Powers
You know this is coming...
Exposed websites? That's hottt.
Had something to do with this somehow....
I'm using git for site backups via --git-dir and --work-tree. In my case, the git directories are located on a completely different (NAS) mountpoint.
For deployment I use git archive in a one-liner that builds a tarball, uploads it to the site, unpacks it, deletes old files and removes said tarball.
For bonus points you can shove that into a cron job that automatically checks out master and you never need to worry about it (I have it in a Makefile).