Key Compromise - eMudhra

A security researcher revealed that the eMudhra Intermediary Certification Authority's private key has been leaked/compromised. What's shocking is the details of this incident.

Who is eMudhra

eMudhra is listed as a Indian digital trust and cybersecurity company which acts as a licensed Certification Authority (CA), responsible for issuing digital signature certiicates, website security and paperless government solutions.

For example, the green lock you see on the browser is because the web server has a digital certificate corresponsing to the URL and other prescribed information and is digitally signed by the CA. Browsers verify the certificate by examining the "chain" of the certificate from the Root CA, then on to the Intermediate CA(s) and finally right to the webserver's certificate. If any one of the certificate isn't validated, then the check fails and you get an error.

Note that you can create your own Root CA/Issuing CA with a command line tool like OpenSSL. However, in order for the CA to be recognised, you have to be enrolled into the Browser Forum who will have set of requirements to ensure that your setup is audited and has sufficient protection.

Besides browsers, other applications also does the same checks to ensure that the encrypted connection is secured and verified.

eMudhra was founded at 2008 in Bengaluru, India. eMudhra has issued tens of millions of digital certificates.

A primer on Certification Authority

A digital certificate is a cryptographic document which contains a public key and the private key. The public key is the "public certificate" which is available publicly for anyone to download and inspect. The private key is kept hidden by the user and is only used for cryptographic function.

For a web server, the private key is used to decrypt the TLS encrypted traffic so that the web application is able to process the information. For a CA, the private key is uses to sign a certificate request, which then becomes the public digital certificate.

At the top of the trust chain, is the Root CA. The Root CA has the whole "schbang" of security implemented, right from key signing, splitting and secure storage in tamper proof hardware (following standards such as FIPS-140-2/3). A Root CA has long lifespan (i.e. 20-25 years). Root CA only does CA signing and does not issue any other type of certificates.

Right below Root CA, you have Intermediate CA. Some intermediate CA may act like Root CA, and for most cases, the Intermediate CA is the Issuing CA. The role of the issuing CA is to sign end user certificates. Some CA signs only certain types of CA while other setups see Issuing CA signs a whole set of certificates. The CA operator defines how this is done, and you can find the details on the Certificate Practice Statement (CPS). The CPS is defined as part of the CA's certificate details.

What happened so far?

According to eMudhra, there are about 30,000 cerrificates that needs to be migrated over. The major browsers such as Mozilla, Google and Cloudflare) have blocked eMudhra's 8 Intermediate CA certificates. The reason for the blocking is because the private key for these CA's have been generated ith critically weak randomness due to very small sequential number (0-255).

In actual fact, the private key for the ICA is 4. Yup, number 4. That's it. That's all.

This is a properly formed random based P-384 private key, generated for test purposes. Feel free to knock yourself out if you think this key protects anymore than RM0.10.

Imagine, instead of that garbled random, you only see a number 4 inside those ASCII boundaries.

So what if the ICA is compromised

The ICA is responsible for validating certificates before it gets used in public. An ICA will not sign unless if its identity is confirmed. In this incident, since the private key is now public, anyone can sign a certificate request pretending to be Google or Apple, essentially making an Man-In-The-Middle attack successful since that particular certificate is effective.

Some of the ICA for eMudhra is used for code signing. For browser website purposes, Certificate Transparency (CT) publishes issued certs, but for other purposes, this isn't the case. CT provides means to validate a public certificate independently based on a publicly available register.

Some countermeasures

How was the key compromised?

What's next?

Author: ORCID ID - Suresh Ramasamy: 0000-0003-4562-037X

This article is mirrored in Linkedin at

links

social