News for hackers. Stuff that matters.
Re:One in every 600 websites has .git exposed by phantom_oracle on Sunday July 26, 2015 @08:36PM (#9952782)
Imagine you implement every type of possible security...

Keeping your entire server-stack up-to-date, making sure you have SSL, using strong encryption for logging-in, hashing the passwords, making sure your server can only be reached via SSH, adding firewalls, filters, etc. etc.

Then some hacker in Eastern Europe comes along (or some beginner at the NSA/GCHQ) and finds out that your .git is exposed and somehow gains all vital user-data and admin data.

Being bashed with a boulder repeatedly would probably be less painful than the torture of knowing "I did it all, but they got me with an HTTP request... because nobody thought of double-checking what our VCS is doing".

How many other glaringly obvious mistakes might be out there right now? I can only imagine.

Re:One in every 600 websites has .git exposed by vog on Monday July 27, 2015 @03:57AM (#9953939)
You seem to imply this is a novel attack vector. But it's really just an instance of a very old mistake:

Don't use the root of your app as document root!

It's really as simple as that. Almost all modern apps have a subdirectory "public/" or similar. That one is meant to be used as document root. You only have to ensure there are no sensitive files in there.

If you fail to introduce such a directory, you'll have a game of cat-and-mouse, where you have to add extra webserver rules for each sensitive file: VCS, crypto secrets, private keys, and so on. In that setup it's easy and very likely to forget one. Of course, this then creates the feeling of "How can anybody keep track of this never ending list of security details?"

In the end, this is a blacklist vs. whitelist thing. Like with your firewall, you want one rule that blocks everything and allows only specific stuff. The alternative is to allow for everything, have rules to deny all sensitive stuff, and finally get in trouble for having forgotten one rule (e.g. probably because an additional service was introduced after the firewall rules have been written.)

Re:One in every 600 websites has .git exposed by juliangregorian on Monday July 27, 2015 @05:24AM (#9954190)
Great point. How much do you want to bet most of these are PHP, where it takes special discipline not to make your top directory web-accessible?
Re:One in every 600 websites has .git exposed by pmx on Monday July 27, 2015 @08:19AM (#9954688)
It takes very little effort in php. You simply have your index.php and any public assets in the document root and then use index.php as a bootstrap to bring up your application. Everything else goes outside of the document root.
Re:One in every 600 websites has .git exposed by vog on Friday July 31, 2015 @03:16AM (#9980380)
Yet, almost all well-known PHP applications don't have a public directory. And almost all non-PHP webapplications do have a public directory (e.g. practically all Python/Django and Ruby/Rails projects).

So the connection to PHP is apparent till today, although it may have to do more with crappy super-cheap hosting providers than with the language itself.

Re:One in every 600 websites has .git exposed by leftnode on Monday July 27, 2015 @09:37AM (#9955069)
Very simple setup. You have:

    .git
    web/index.php
    src/*.php
Make the document root /full/path/to/web/index.php.

Edit: Also use a deployment tool like Capistrano which removes the .git directory as well.

Re:One in every 600 websites has .git exposed by vog on Monday July 27, 2015 @09:59AM (#9955211)
Yes, it is easily avoided. But it is still violated by lots of PHP projects, including well-known projects with large userbases:

    * Wordpress
    * Tiki
    * ... and so on.
I don't think this is by accident: This technique is too old and well-known to be ignored by large projects. Rather, they conciously don't do that to cause less hassle for the occasional admin: Those can simply dump it into some directory and don't have to setup a proper docroot or anything. And extra work for those who want a more secure setup.

This is clearly a usability versus security issue, resolved in the unfortunate, usual way.

Re:One in every 600 websites has .git exposed by jbeales on Monday July 27, 2015 @10:51AM (#9955483)
I don't have insight into the decision-making at WordPress, but they probably do this because they want to be compatible with as many web hosts as possible, and so many super-cheap shared hosts just give you a public directory that you're supposed to dump everything in.

It's possible to set it up properly on most of these hosts, but it's much more difficult, and if you ever have issues the support team says you're using a "non-supported configuration." At least WordPress lets you move your config file one level above the webroot and will find it automatically.

Re:One in every 600 websites has .git exposed by juliangregorian on Monday July 27, 2015 @12:24PM (#9956132)
Drupal, MediaWiki, Laravel, Slim, it's a pretty long list, and it includes projects that target Serious Devlopers.
Re:One in every 600 websites has .git exposed by vog on Monday July 27, 2015 @12:35PM (#9956224)
Also, this is really PHP specific.

Look at any larger Python (Django/Flask/...) or Ruby (Rails/...) project, and you will always find a proper "public" directory, although it may be named differently.

Not sure about Perl though ...

Re:One in every 600 websites has .git exposed by TazeTSchnitzel on Monday July 27, 2015 @06:19AM (#9954326)
Does it? If you're on a shared host with just the one directory, maybe. But if you are configuring your own server, you still point it to htdocs and keep the config below it.
Re:One in every 600 websites has .git exposed by Dylan16807 on Sunday July 26, 2015 @09:13PM (#9952878)
Wrong lesson.

Don't put secret keys in your repository.

Someone getting a copy of your code should be a big annoyance at worst.

Re:One in every 600 websites has .git exposed by stickfigure on Monday July 27, 2015 @12:02AM (#9953251)
Don't put secret keys in your repository is also the wrong lesson.

The right lesson is: Know where your secret keys are and take the appropriate steps to secure them. Whether that's in the codebase, a properties/ini/conf/whatever file, environment variables, whatever - know where they are and make sure you understand possible threats against them.

This story could just as easily have been written about how easy it is to download ALL_THE_SECRETS.txt. Don't feel smugly secure just because you don't store passwords in git.

Re:One in every 600 websites has .git exposed by Dylan16807 on Monday July 27, 2015 @02:35AM (#9953697)
Putting keys in a text file doesn't fit the narrative of a generally-careful user forgetting about side effects and metadata.

It's important to know where your keys are, but it's also important to not store your keys in certain ways that are easily overlooked.

A lesson of "don't put secret keys inside the web root" is also useful.

But a lesson of "know where your keys are and secure them" is a bit too short-sighted. You don't just want them to be secure right now, you want the mechanisms keeping them secure to be mistake-resistant.

Don't put them in the code, even if you promise to be super careful.

Re:One in every 600 websites has .git exposed by jsprogrammer on Monday July 27, 2015 @01:30AM (#9953505)
Is there a general algorithm that can tell you all possible threats against your secret keys?
Re:One in every 600 websites has .git exposed by danudey on Monday July 27, 2015 @03:58AM (#9953941)
My approach to security, when discussing things with our engineers:

1. Make a list of everything that absolutely positively cannot live without this data/access/permissions/etc.

2. Put the data somewhere where absolutely nothing whatsoever can ever read it (except root).

3. Figure out what one single change will resolve #2 so that the things in #1 can happen without any other things gaining access.

If you don't do #1, you don't understand your requirements/applications. If you don't do #2, then your data is probably vulnerable through some other mechanism. If you can't do #3 then you probably need to change something else (e.g. stop running all processes as the same user, stop running all services on the same box, stop trusting users, set up more granular sudoers rules, etc).

What I find is that when you come up with an idea for #3, and then come up with a list of side effects, you can actually find a lot of the kinds of issues I mentioned above, for example where the public website CMS (as 'daemon') and the accounting backend (as 'daemon') both have access to the same resources, and thus someone gaining access to the CMS can get the accounting DB user/pass and get access to your transaction records, user database, etc.

Re:One in every 600 websites has .git exposed by lmm on Monday July 27, 2015 @02:29AM (#9953678)
No, there are an infinity of things that shouldn't have access to your secret keys. So you have to take a default deny approach, and ensure that only things that positively should have access to your secret keys do.
Re:One in every 600 websites has .git exposed by dangero on Sunday July 26, 2015 @09:24PM (#9952911)
Where is the right place to store db passwords, api keys, etc? What is best practice in this area?
Re:One in every 600 websites has .git exposed by cddotdotslash on Sunday July 26, 2015 @11:52PM (#9953228)
I use AWS for a number of applications, so I've started doing the following:

1. Create a JSON file containing encrypted secrets (DB pass, etc.)

2. Upload the file to a secure S3 bucket with fine-tuned permissions and server-side encryption

3. For the instance that is launching, include the permission in the IAM role that allows it to "S3:GetObject" on the specific JSON file you uploaded.

4. Deliver decryption keys to the app in some manner (Chef, Ansible, etc.)

5. When the app starts, it downloads the JSON file and loads the environment variables.

I wrote a blog post[1] about this with more detailed info and an NPM module if you use Node.js.

[1] http://blog.matthewdfuller.com/2015/01/using-iam-roles-and-s...

Re:One in every 600 websites has .git exposed by err4nt on Monday July 27, 2015 @10:11AM (#9955282)
This system is truly beautiful, I think one of the best suggestions in the thread (definitely the best self-rolled solution not using other tools)

I have a question about redundancy or "What happens if your gatekeper EC2 instance goes down"? If you have multiple gatekeepers could they be set up this way:

- let's say you have five different web apps using a gatekeeper to hold their secrets

- let's say you have n gatekeepers (let's say 3) and each of the apps knows the address of all three gatekeepers.

- If the primary gatekeeper is unreachable, all five apps would try to contact the secondary gatekeeper, but that gatekeeper would only (ever) respond in the event that the secondary gatekeeper also found the primary gatekeeper unreachable.

It's like a sleeper cell - at any given moment you have multiple replacement gatekeepers ready and waiting to serve, but each of them is unable to respond unless the one above it in the list stops responding. In this way you could lose gatekeepers (even permanently) and build a little bit of resilience into the apps depending on it while you're able to sort out what happened and restore normal behaviour.

Is this a good idea?

Re:One in every 600 websites has .git exposed by cddotdotslash on Tuesday July 28, 2015 @12:16AM (#9959485)
I'm confused by your reference to "gatekeeper EC2 instances." In the scenario I described, the secrets are housed on S3, not a separate EC2 instance. So, theoretically, as long as the underlying instance running the application code can access S3, and S3 doesn't go down (very unlikely), there shouldn't be any issues.
Re:One in every 600 websites has .git exposed by mahmoudimus on Monday July 27, 2015 @01:16AM (#9953468)
Yeah, we take this same approach. I wrote an ansible module that does this.
Re:One in every 600 websites has .git exposed by burke on Sunday July 26, 2015 @09:51PM (#9952972)
We (Shopify) use https://github.com/Shopify/ejson -- we store encrypted secrets in the repository, relying on the production server to have the decryption key.

It's relatively common to provision secrets with configuration management software like Chef/puppet/ansible/etc using, e.g. Chef's encrypted data bags.

Another slightly heavier-weight solution with some nice properties is to use a credential broker such as Vault: https://www.vaultproject.io/

Re:One in every 600 websites has .git exposed by e12e on Monday July 27, 2015 @01:22AM (#9953486)
For ansibile the built-in solution is: http://docs.ansible.com/ansible/playbooks_vault.html
Re:One in every 600 websites has .git exposed by notduncansmith on Sunday July 26, 2015 @10:45PM (#9953085)
Just wanted to +1 the suggestion for Vault - I've found it to be a really nice balance between usability and security.
Re:One in every 600 websites has .git exposed by tokenizerrr on Sunday July 26, 2015 @09:30PM (#9952924)
Environment variables are the best and easiest way that I know of. You can supply those anyway you want to, and any programming language can easily get their values.
Re:One in every 600 websites has .git exposed by jsjohnst on Monday July 27, 2015 @12:23AM (#9953329)
Glad I don't work at your shop then. Environment variables are a terrible way to give your app secure information. There's well over a dozen reasons why you shouldn't do this in your apps, but one super obvious one is there's way to many frameworks that expose environment variables in their debug output if not properly configured. Think you'll never misconfigure a server? Guess again, pretty much every major site (Google, FB, Twitter, Yahoo, EBay, Microsoft, etc) have all done it at some point.
Re:One in every 600 websites has .git exposed by tokenizerrr on Monday July 27, 2015 @05:16AM (#9954164)
Please review HN's guidelines on civility.
Re:One in every 600 websites has .git exposed by jsjohnst on Monday July 27, 2015 @08:28AM (#9954709)
Fair point, I potentially should've left off the first sentence. I stand behind the rest of the post, but the first sentence is a bit on the edge and I apologize.
Re:One in every 600 websites has .git exposed by tokenizerrr on Monday July 27, 2015 @08:32AM (#9954726)
Alright, well, I've never seen an application/framework spit out environment variables when it was misconfigured. But then again, I barely work with web-related stuff so maybe I just don't use the kind of software that does this. Could you provide some examples?
Re:One in every 600 websites has .git exposed by damon_c on Monday July 27, 2015 @09:36AM (#9955063)
Many web frameworks do this when in "debug" mode.
Re:One in every 600 websites has .git exposed by dang on Monday July 27, 2015 @03:07PM (#9957292)
Your comment sounded more colloquial than uncivil to me, but thanks for responding so respectfully.
[dead]
Re:One in every 600 websites has .git exposed by tokenizerrr on Monday July 27, 2015 @07:11AM (#9954470)
I'm glad you made a new account named 'shutupbitch' just to tell me this. Thank you for your contribution.
Re:One in every 600 websites has .git exposed by dang on Monday July 27, 2015 @03:06PM (#9957286)
Please don't feed trolls.
Re:One in every 600 websites has .git exposed by otterley on Tuesday July 28, 2015 @11:22PM (#9965993)
The "dump environment" problem is an issue for novice developers, but mature shops should have security-conscious frameworks for secrets handling that do things like clear the variable from the environment at initialization time.

What are your other 11 objections?

Re:One in every 600 websites has .git exposed by alexisnorman on Sunday July 26, 2015 @11:35PM (#9953195)
I'm surprised this isn't higher up. Are there any arguments against ENV variables in favor of something else?
Re:One in every 600 websites has .git exposed by smtddr on Monday July 27, 2015 @12:07AM (#9953277)
Here's my caution to this. If low level processes can do "ps aux", and they see something like:

DB_USER=scott DB_PASSWORD=b3withm3pl3aze /usr/bin/python webapp.py

That could be troublesome if an attacker figured out a way to run remote commands on your server even as an unprivileged user.

Re:One in every 600 websites has .git exposed by Dylan16807 on Monday July 27, 2015 @11:57AM (#9955915)
When I test that, the command line does not include the variable-setting. Is this a problem that depends on version or are you mistaken?

It would be kind of weird to include that considering how argv works.

Re:One in every 600 websites has .git exposed by yrro on Monday July 27, 2015 @05:57AM (#9954268)
Reading the environment of another process is a privileged operation.
Re:One in every 600 websites has .git exposed by smtddr on Monday July 27, 2015 @05:23PM (#9958105)
If an attacker can get the process that's running the webapp.py to exec some abitrary bash command, that process has the ability to read its own /proc/$PID/environ . In general, you can read /proc/$PID/environ on processes that you own. At least I can do that on my Debian system:

    pikachu@POKEMONGYM ~ $ sleep 99 &
    [1] 21340
    pikachu@POKEMONGYM ~ $ cat /proc/21340/environ
XDG_SESSION_ID=5COMP_WORDBREAKS= "'><;|&(:TERM=screenSHELL=/bin/bashXDG_SESSION_COOKIE=8571b679eed8952dd96ad28a54...<etc>

(I actually gave the wrong example in my previous comment. While it is true that giving the ENV on cmdline will show up in ps eaux, the more appropriate example is what I just explained in this comment.)

Re:One in every 600 websites has .git exposed by tokenizerrr on Monday July 27, 2015 @06:38PM (#9958463)
If you can get it to exec some arbitrary bash command (or otherwise access the environ of a process) you can also have it cat any file on the server, and even the memory of the running processes that belong to the same user as the exploited process, and also execute network requests. So if you get that far, pretty much nothing will protect you.
Re:One in every 600 websites has .git exposed by smtddr on Monday July 27, 2015 @07:12PM (#9958613)
Sure, but there are some shops that do their security from a point-of-view of "Attacker can run commands on your server as the user that started whatever-public-service/webapp/api", and go from there. I happen to think that's the best way to think about it.

Now, if an attacker manages to get root access then it's game over[1]. That just shouldn't happen. But nobody should be running their webserver as root. So, whatever that user is should be low-powered with only enough privileges to start the webserver & bind port 8080 (and use iptables or whatever to reroute connections to port 80 --> 8080) and the whole setup should be designed that this account won't be able to escalate things further if someone got a bash shell to it.

______

1. You should at least have some way of detecting that it happened and consider all data & files compromised and just wipe the whole machine & start over. Or take that machine offline for investigation into what happened and put a fresh new one in its place.

Re:One in every 600 websites has .git exposed by yrro on Wednesday July 29, 2015 @07:39PM (#9972388)
If an attacker can run an arbitrary command on your server, it's already time to rotate all the credentials in your system and let any data subjects whose data you hold know that you fucked up, big time. That's just the Linux model.
Re:One in every 600 websites has .git exposed by vidarh on Monday July 27, 2015 @07:40AM (#9954564)
The example above is someone who have stupidly started a process with the environment variables exposed on the command line
Re:One in every 600 websites has .git exposed by yrro on Wednesday July 29, 2015 @07:34PM (#9972361)
Ok, but that's not a problem caused by the exposure of the environment, it's caused by the exposure of the command line.
Re:One in every 600 websites has .git exposed by vidarh on Thursday July 30, 2015 @04:56AM (#9973811)
I agree - I was just explaining what the issue the above commenter raised. It just means you should use a saner way of initializing your environment with sensitive values.
Re:One in every 600 websites has .git exposed by marcus on Sunday July 26, 2015 @11:58PM (#9953240)
ENV variables are inherited by child processes by default, so please use care when using this approach.
Re:One in every 600 websites has .git exposed by tfigment on Sunday July 26, 2015 @10:29PM (#9953060)
My preferred solution currently is to use try to use encrypted strings in config files that are not stored in VCS. The host machine encrypts and decrypts using host specific keys so if the file is copied off-server, it is not fully compromised immediately. This is usually via python script which rewrites the file. (BTW, pretty easy to do on Windows boxes with MS API). I've considered using encrypted folders on windows in addition but not sure if that really makes a difference.

Usually the base config is in VCS but without user/password/db strings. We then manually configure the file with the encrypted strings on the server (usually with the machine name in the filename so that we can use hostname in code to find it and makes it clear the file is machine specific). Not all tools make this easy though and only works if you can add your own code in between. Also prefer files to environment as the files can be locked down easier in my opinion and more obvious what is going on.

I like some of the other solutions that are using encrypted strings but with a keystore server and may consider for the future if they support both windows and linux.

Re:One in every 600 websites has .git exposed by mycelium on Sunday July 26, 2015 @09:29PM (#9952919)
Stack Exchange's blackbox [1] is one solution. I haven't played with it personally and I'd love to hear other people's take on what's worked for them.

[1] https://github.com/StackExchange/blackbox

Re:One in every 600 websites has .git exposed by thaumaturgy on Sunday July 26, 2015 @09:35PM (#9952934)
FWIW I have a /private directory in the root of all vhosts, so it looks like:

    /srv/www/domain.com/public_html/
            |--------->/private/
            |--------->/logs/
            |--------->/tmp/
Anything stored in /private/ is not publicly accessible by the web server process, but can be read or written by anything running under the user's username.

It's specifically for storing things like configuration files.

I think this should be standard practice.

Re:One in every 600 websites has .git exposed by dangero on Sunday July 26, 2015 @09:39PM (#9952941)
Thanks for the tip. How do you keep passwords and keys in sync amongst team members safely?
Re:One in every 600 websites has .git exposed by thaumaturgy on Sunday July 26, 2015 @09:46PM (#9952957)
I only just recently had to figure that out. I opted for setting up a .kdb KeePass file in a private git repo and giving everyone ("everyone" = myself + one other) access to that. I'm pretty sure that's not a very good solution.
Re:One in every 600 websites has .git exposed by raquo on Sunday July 26, 2015 @11:57PM (#9953237)
Why do you store such stuff under /public_html anyway? One level higher would be more appropriate I think.
Re:One in every 600 websites has .git exposed by thaumaturgy on Monday July 27, 2015 @12:09AM (#9953288)
It's not under public_html. It's under /srv/www/domain.com. It is one level higher.
Re:One in every 600 websites has .git exposed by raquo on Monday July 27, 2015 @03:27AM (#9953862)
Oh, that makes more sense. Sorry I got confused by the ascii tree.
Re:One in every 600 websites has .git exposed by craigkerstiens on Sunday July 26, 2015 @11:29PM (#9953183)
http://12factor.net provides a good guidance for this at a high level. In reality all config should be separated from code.

There's a variety of mechanisms for loading this into your environment.

Re:One in every 600 websites has .git exposed by gabetax on Sunday July 26, 2015 @09:51PM (#9952974)
You can use a datastore like HashiCorp's vault: https://vaultproject.io
Re:One in every 600 websites has .git exposed by mdpopescu on Monday July 27, 2015 @06:02AM (#9954284)
Windows has something similar in DPAPI - https://msdn.microsoft.com/en-us/library/ms995355.aspx
Re:One in every 600 websites has .git exposed by bobwaycott on Sunday July 26, 2015 @09:56PM (#9952988)
Config files that are not version controlled, or environment variables. I prefer config files because it's easier for me to communicate to other team members what needs to be present in their local development environment.

I typically handle this by versioning a `config.example` file, which includes all the necessary config keys an application expects. The example file defaults these attrs to various strings meant to show they are examples only. I include instructions to copy the `config.example` to a `config.yml` (or some other appropriate extension), and replace the values as necessary. The `config.yml` file is specifically excluded in the `.gitignore` file. The application will only load the `config.yml` file when started, so I also ensure to raise a descriptive error informing team members when they are missing a local `config.yml`.

This allows the `config.example` to also serve as a self-documenting config for the application, as comments can be included that identify and explain each of the config keys and their purposes.

Re:One in every 600 websites has .git exposed by bigmac on Sunday July 26, 2015 @09:45PM (#9952954)
Keywhiz is a good solution. See here for some background info: https://square.github.io/keywhiz/

Disclaimer: I worked on it.

Re:One in every 600 websites has .git exposed by ars on Monday July 27, 2015 @01:04AM (#9953429)
I store dummy values in VC, then edit the real data on the production server. (And I obviously never check anything in from production, if you can set the production VC user to read only.) This has a nice side effect that if I edit the configuration file the new stuff gets merged in without causing a mess.

Another way is a second file that overrides settings as needed. Although I have found that to be less maintainable if the configuration file changes. That file should be somewhere entirely out of the VC tree.

Either way, the file must be placed in a directory that is not served by the web server.

/include

and

/public

are traditional. Only /public is exposed by the web server.

Re:One in every 600 websites has .git exposed by crdoconnor on Sunday July 26, 2015 @11:43PM (#9953210)
Re:One in every 600 websites has .git exposed by corford on Monday July 27, 2015 @03:27AM (#9953861)
Re:One in every 600 websites has .git exposed by tracker1 on Monday July 27, 2015 @12:39AM (#9953374)
For me, I have connection criteria for a configuration database as environment variables... the config library will then connect to the configuration server with those credentials and get everything that application needs to connect to other services... I'd considered using etcd for this, but was unstable for me at that time... I keep settings cached for 5 minutes, then the library will re-fetch, in case they changed.
Re:One in every 600 websites has .git exposed by emmelaich on Monday July 27, 2015 @09:29AM (#9955026)
I think that if you're using git,

    use git crypt[1][2]
    use git-dir and work-tree options/env vars
[1] https://www.agwa.name/projects/git-crypt/

[2] though you have to remember to git crypt lock

Re:One in every 600 websites has .git exposed by X-Istence on Sunday July 26, 2015 @09:28PM (#9952918)
In a configuration file that is not version controlled, or even environment variables, so that your application starts with the right variables, but they are not in some config file.
Re:One in every 600 websites has .git exposed by dangero on Sunday July 26, 2015 @09:33PM (#9952926)
How do you communicate that data amongst team members then?
Re:One in every 600 websites has .git exposed by bobwaycott on Sunday July 26, 2015 @10:27PM (#9953057)
As I detailed in my other response to your original question, use an example config file that is version controlled. It includes all the necessary config keys, but example-only values. All team members would then be able to easily create a local config file based on the example that works. You can even document the config with comments in the example file so devs know what is needed and what it's for.
Re:One in every 600 websites has .git exposed by whoisthemachine on Sunday July 26, 2015 @10:18PM (#9953031)
I think at one point, if you have a shared password for a development DB, production DB, etc. then just keeping those on a pen and paper notebook is your best solution. Usually, for shared environments such as that (although I hope the team can set-up their own DB's for development!), the number of shared "secrets" is relatively small. Some secrets are best not stored electronically, especially if they can give away user data.
Re:One in every 600 websites has .git exposed by anantzoid on Monday July 27, 2015 @12:01AM (#9953250)
Can also try maintaining a different repository of passwords and and pulling it on to the server during deployment.
Re:One in every 600 websites has .git exposed by Negitivefrags on Monday July 27, 2015 @12:11AM (#9953292)
This is the asymmetric nature of security in general.

You only need to make a single mistake and you are hosed. Your attacker can fail an arbitrary number of times and only needs to succeed once.

If you are 99.9% likely to make the right call on anything that could have a security impact then you only need to make 1000 decisions before you probably screwed one up and have a hole.

Some would say this means true security is impossible.

Re:One in every 600 websites has .git exposed by err4nt on Monday July 27, 2015 @10:00AM (#9955216)
As humans are fallible, it's inevitable we will make mistakes carrying out even what we intend to do, when we know it and are actively trying to do the right thing.

Sometimes our mistakes are not recognizing the right thing to be done, or not recognizing anything at all.

I think the view that true security is impossible is true if security is up to one person. What about a system with multiple layers of sign-off, or an automated system that can help test the security of what you're doing and alert/prevent dangerous behaviour without specific reasons.

Re:One in every 600 websites has .git exposed by totony on Sunday July 26, 2015 @09:13PM (#9952879)
A good practice is to disable features that you don't use. I don't think many people need their hidden files to be remotely accessible, so maybe they should either remove the permissions or set a flag in their server so it doesn't allow downloading them.
Re:One in every 600 websites has .git exposed by ejcx on Sunday July 26, 2015 @09:52PM (#9952977)
I did a conference talk at derbycon on exactly this, regarding startups. The amount of obvious holes of founders not knowing what XSS is, or writing bad PHP apps with obvious code execution vulns, or glaring logic and auth mistakes allowing full account hijacks is incredible.

It's really bad out in AppSec land

Re:One in every 600 websites has .git exposed by tracker1 on Monday July 27, 2015 @12:42AM (#9953384)
Hell, I recently saw an application where there was unchecked input for being able to download files outside the application... if you passed it a path of, for example `../../somefoo-file` would take you out of that application's path.
Re:One in every 600 websites has .git exposed by ejcx on Monday July 27, 2015 @01:11AM (#9953451)
This is called either a Local File Inclusion or a Directory Traversal Vulnerability. The name depends on the details. It's really really common, and definitely something I see a lot of.

The OWASP Top 10 is deadly.

Re:One in every 600 websites has .git exposed by RowanH on Sunday July 26, 2015 @10:49PM (#9953091)
Link to your talk ?
Re:One in every 600 websites has .git exposed by ejcx on Sunday July 26, 2015 @10:55PM (#9953098)
It was my first conference talk. If you would like to ask any questions email me at the one in my profile

https://m.youtube.com/watch?v=wzrVYyouQTk

Re:One in every 600 websites has .git exposed by flihp on Monday July 27, 2015 @11:13AM (#9955618)
This is what makes security hard: To attack successfully you only have to find one significant mistake, to defend successfully you can't make any mistakes.
Re:One in every 600 websites has .git exposed by dschiptsov on Monday July 27, 2015 @11:02AM (#9955554)
What "all vital user-data and admin data"?
Re:One in every 600 websites has .git exposed by GuiA on Sunday July 26, 2015 @08:49PM (#9952815)
Well, that's why you either have a team of competent people making sure all your stuff is up to date, routinely performing pentests, etc., or you delegate as much as possible of those responsibilities to 3rd parties (e.g. Heroku).
Re:One in every 600 websites has .git exposed by electic on Sunday July 26, 2015 @08:52PM (#9952821)
Doesn't matter. Eventually, there is a 0-day, that no one knows about, that is used on you.