Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Security implications of disabling the Common Name check for HTTPS

I'm going over some client code I've inherited for doing secure communication over HTTPS, and it seems that it's not checking the common name in the server certificate (eg. 'CN = "example.com"' against the actual URL that's being requested. This is probably deliberate, since our client app is required to talk to various environments, so after contacting an initial portal (eg. example.com/main) and the user choosing an environment the app gets redirected to a specific IP, so all future requests look something like "http://127.0.0.1/page".

However being an SSL newbie, I'm unsure of the implications of disabling this check. My first reaction would be that it'd be easier to perform some kind of man-in-the-middle attack, since someone else could just copy our certificate and pretend to be one of our servers. But if we were doing common name checking you'd be able to do the same thing with custom DNS settings anyway, so it doesn't seem to actually gain us anything. Are there other attacks that this leaves us open to which we wouldn't be otherwise?

Thanks

like image 755
user22627 Avatar asked Sep 26 '08 10:09

user22627


People also ask

What happens if I disable security certificates?

Important: Removing certificates you've installed doesn't remove the permanent system certificates that your phone needs to work. But if you remove a certificate that a certain Wi-Fi connection requires, your phone may not connect to that Wi-Fi network anymore.

What is the risk of not using HTTPS?

Without HTTPS, any data passed is insecure. This is especially important for sites where sensitive data is passed across the connection, such as eCommerce sites that accept online card payments, or login areas that require users to enter their credentials.

What attacks is HTTPS vulnerable to?

DROWN is a serious vulnerability that affects HTTPS and other services that rely on SSL and TLS, some of the essential cryptographic protocols for Internet security.

Is common name mandatory in SSL certificate?

While generating a CSR, you will be required to enter information in the Common Name field. Certificates are specific to the Common Name that they have been issued to at the Host level. The Common Name must be the same as the Web address you access when connecting to a secure site.


2 Answers

Someone else can't just copy your certificate and use it because they don't have your private key.

If you don't check that the certificate's CN doesn't match the domain name then they can simply create their own certificate (and have it signed by a trusted CA so it looks valid), use it in place of yours, and perform a man in the middle attack.

Also, you need to be checking that the certificate comes from a trusted CA. It's the CA's job to make sure that you can only get a certificate with the CN= if you actually control that domain.

If you skip either of these checks then you are at risk of a MITM attack.

See also this answer for a different approach that will work if you have sufficient control over the client.

like image 142
sherbang Avatar answered Nov 15 '22 09:11

sherbang


If you control the client code, then you can restrict the trusted CAs to just your own. Then the domain check is less important - any of your servers can pretend to be another one.

If you don't control the client code, then a cert signed by a trusted CA can be substituted for yours.

like image 20
Douglas Leeder Avatar answered Nov 15 '22 09:11

Douglas Leeder