posted in Selfhosted
PSA: eMudhra Intermediate CA Compromise
Update your stuff, folks. I’ve had a fun day at work.
emudhra.we-have-a-problem.com/posted in Selfhosted
PSA: eMudhra Intermediate CA Compromise
Update your stuff, folks. I’ve had a fun day at work.
emudhra.we-have-a-problem.com/ELI5?
Replying to @artyom@piefed.social
The encryption that SSL/TLS provides (that puts the “secure” in HTTPS) uses a public–private key pair and a specific mathematical function. Generating the key pair requires a cryptographically secure random number that is impossible or very difficult to guess, which must be kept secret at all times. If this random number is leaked or guessed by a malicious actor, the private key can be reconstructed and used to impersonate a website or break the encryption.
The security of the encryption comes from the fact that the function is easy to calculate one way, but difficult to calculate its inverse. To demonstrate: multiplying the prime numbers 88117 and 44543 is easy, but the inverse, factorizing the semiprime 3924995531, is extremely lengthy in comparison.
One of the factors that determine the security of the key is the size of the number, i.e. the number of digits. In this case, a proper key should’ve had a length of 384 bits (or 116 decimal digits). In reality, the keys that eMudhra used had eight bits, which can only represent 256 possible values, and can be easily guessed even by brute force. The specific private keys were the numbers 4, 56, 66, 115, 155, 156, 230, and 237.
Replying to @rtxn@lemmy.world
... Eight? Eight???
Replying to @Triumph@fedia.io
Four… Fucking… Pixels?
The working hypothesis is that this was some sort of debug or test key that was never meant to be used in production, being used in production.
Replying to @rtxn@lemmy.world
I’m honestly skeptical about even this. I tried to generate an 8 bit key and got rsa_gen_set_params:key size too small.
And like, you need to go deliberately out of your way to not use OpenSSL.
Replying to @tigerhawkvok@startrek.website
They were proper 384bit certs, just the upper 376 bits were 0 in all the listed certs. So it’s different to setting the key size in OpenSSL, and they were most likely rolling their own crypto.