Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

In our company we have an internal CA certificate for signing various things including the proxied (MITM'd) HTTPS connections.

Suppose we use this CA to sign a key for "localhost" for use in automated testing (so we don't have to mess about with custom Firefox profiles). This key would be distributed to the developers, probably by checking it into the source repo.

What are the dangers of this approach? Suppose an attacker stole the key, and could then sign localhost HTTPS. What could they do?

share|improve this question
    
possible duplicate of What are the risks of self signing a certificate for SSL –  Terry Chia Apr 29 '13 at 13:06
1  
@TerryChia It's not a self-signed certificate in the usual sense - the CA is already installed in all the browsers in the company. Also, it's for "localhost" only. –  artbristol Apr 29 '13 at 13:08
add comment

3 Answers

up vote 3 down vote accepted

I don't see any more significant threat for localhost than any other certificate. The main abuse of an SSL cert is to convince a system that you are the system they want to talk to when you are not, but an attacker couldn't compromise the traffic going to localhost unless the client computer is already compromised at a fairly low level (at least has access to modify the HOSTS file). At which point, the entire charade is unnecessary since they could simply install their own cert or do whatever else they want.

share|improve this answer
    
So would you agree that it's a reasonably safe thing to do? –  artbristol Apr 29 '13 at 13:14
    
I think it is safe, but not necessarily the best. What do you gain over a self-signed and locally trusted certificate produced on the developer's machine? Locally signed certs could also be used for the developer's machine name. For example, my development box has a self signed cert that is valid for both localhost and mymachine.mycompany.com and is only trusted on my machine since nobody else actually needs to trust it. –  AJ Henderson Apr 29 '13 at 13:24
    
All I'm trying to gain is a bit of build simplicity - when you run Firefox in WebDriver, it starts with a clean profile, which in our organisation already trusts the internal CA. I'd have to add a self-signed certificate by hand otherwise. But I like the idea of signing the developer's machine name, maybe I'll look into that. –  artbristol Apr 29 '13 at 13:31
    
@Artbristol - I'm trying to remember, does Firefox by default trust certificate's in the Windows Crypto API? It's reasonably easy to write automated code to create certificates and register them to the Crypto API. There is actually even a .Net Library for doing it on CodePlex (though the name eludes me at the moment unfortunately). –  AJ Henderson Apr 29 '13 at 13:51
add comment

With such a certificate, any system who trusts your internal CA will trust a server running on "localhost" as being genuine, i.e. running really on "localhost". But "localhost" can be reached, network wise, only locally, so if your client successfully connects to https://localhost/whatever then it already knows that it is talking with the local machine. Therefore, no extra security issue.

Of course, the certificate only authenticates the host name. It says nothing about whether the server is malicious or benign, only about who the server is.

Mind, though, that if someone modifies the local "hosts" file, then accesses to "localhost" could be redirected elsewhere -- but someone who can do that on your machine already owns it and could insert his own rogue CA in your trust store anyway.

share|improve this answer
add comment

There's almost no threat at all. Do you trust your own computer not to attempt an MITM attack against you? Then there ought to be no problem.

When you try to access localhost, the network adapter isn't even touched. If someone stole the key, the could use it to convince their own computer that it is itself. Or any computer that they have access to (if they have access to computers, however, you have a bigger problem since they can intercept the unencrypted data before it goes through TLS)

The only danger would be if your hosts file has been tampered with.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.