A lot of people don't use "svn export" and leave .svn directories readable to everyone.
The authors of the article wrote a crawler that scanned 2.2 million domains, mostly in the .ru zone, for the vulnerability over the last couple of months.
They got access to (parts of) the source code of over 3 thousand sites, including some big ones like:
* yandex.ru and rambler.ru -- Russian search engines
* mail.ru -- Biggest Russian email host
* rbk.ru -- Large online publisher
* 003.ru, bolero.ru -- Online retailers
* habrahabr.ru -- Webdev/blogging/new media community site
* opera.com
# Disallow viewing of .svn and .git directory contents
<DirectoryMatch \.(svn|git)>
Order allow,deny
Deny from all
</DirectoryMatch>Oh. Now we're blacklisting.
If you are going to use this solution, you are better off blacklisting all dotfiles except .htaccess, assuming you allow it.
location ~ /\.(svn|git) { deny all; }
# Disallow viewing of .svn and .git and .hg directory contents
<Directory ~ \.(svn|git|hg)>
Order allow,deny
Deny from all
</Directory>The issue is not in "using SVN". It's in using any revision control system that has .svn .git etc directories, and accidentally making those directories world readable from a webserver.
User error.
harm: We need more people who, upon finding a hole, go on to scan the whole Runet, for no nefarious reasons but just to warn unwitting site owners.
SilenceAndy: In olden times such people were called hackers, until journalists perverted that word to mean cyber criminals.
grayhex: This comment is impervious to Google Translate.
cancel: Google inurl:.svn/entries, lots of interesting stuff.
Nirvanko: This ain't new, see http://www.adamgotterer.com/2009/01/26/hacking-the-svn-direc...
SynteZ: IIS doesn't have this vulnerability :-) By default it doesn't send files without extensions, because it doesn't know the mime type.
varyen: Funny, Wii disks from SEGA also have .svn folders, though they're empty.
crazywebdev: Now I know how http://vkontakte.ru came about.
It's especially bad because svn puts a .svn in each directory. With e.g. mercurial or git, you can tuck the (visible) site in a subdirectory of the repo itself (project/pages), and the .hg/.git (project/.hg|project/.git) won't be accessible.
Of course the best option is still to use exports and symlinks.
http://www.subversionary.org/martintomes/preventing-access-t... http://blog.samdevore.com/archives/2006/05/01/hivelogic-prev...
Don't blame the tool, blame the individual for using it improperly.
I use Mercurial on all my websites (disabling access to .*/.hg of course) and never use FTP for anything.
It's clearly faster, it clearly is not safer, as the article demonstrate: if you forget to configure Apache to ignore the repo folders, your source code becomes available to the world.
> you can have hooks to do some cleanup and rollbacks are almost free
Export to versioned directories, then use symlinks to link your core to the right version of the site, and you get rollbacks for free as well. The only thing a WC gets you is deployment speed.
So when I deploy updates to sites we pull and update the changes then merge a locally stored patch queue to reconfigure the settings.
Because the settings are locally stored on the server (not in the site root) there is no way for people to steal the details from the public mercurial server :D
I know SVN creates these hidden directories (named .svn) within every directory of my project that contains the working copies of the files within that directory. Therefore I either use export (to not upload the hidden folders) or I make them not accessible to the public via .htaccess.
Saying this is a vulnerability is like telling someone copying/pasting their code into a Pastie is a vulnerability. Common sense.
Saying it's not a vulnerability when 3,000 sites all have their source code visible to the world is like having your arm chopped off and saying "no it isn't, it's just a flesh wound."
I know it's not a cool remote root buffer overflow exploit hat trick 540 front side flip, but it's a security hole which people need to be educated about.
I guess it is a vulnerability of the same standard as "My password is: password".
I just don't understand why everyone is up-in-arms and so surprised by this "vulnerability." It's common sense...
It would seem that in the XXI century is difficult to find such a vulnerability.
Do Russian speakers generally write the century in roman numerals like that? That's kind of neat..
I thought not checking in safety critical things such as passwords or keys into the repository tree is a standard practice. If it's not, it should be.
If the threat is finding vulnerability, then you are right. If the threat is leaking the source code to the competition, then it is a serious matter.
Also, keep in mind the deployed source code is different than just the source code; it usually contains things like the database credentials and such.
About leaking the source: Yes, that could definitely be a problem, I agree, but I'm not sure if this can be considered as a vulnerability, more like carelessness on the part of the admin of the site.
Google translate is good at lexical translation but still can't bind words together properly (and probably never will unless they'd change their paradigm).
I have to add that original text is surprisingly incoherent. They surely didn't re-read it after they wrote it.
It appears that IIS is naively not serving up these file types. If I drop a plain html file in the .svn folder I can get to it, but any .svn-base file or files lacking an extension are unreachable.
Are they saying that people can read your code (not actually a problem for open source projects) or that they can update it and thus alter your site?
The former doesn't seem so bad - the latter is obviously catastrophic.
I wish I spoke Russian...