What the eMudhra Certificate Case Taught Us About Infrastructure as Code

AI-generated image for Orbitant's blog about infrastructure as code, featuring a digital outline of a fractured padlock formed by network mesh and binary code in cyan light against a dark background.

ou can keep every piece of software fully up to date and still not be safe from someone impersonating your bank with a green padlock and a perfectly valid certificate. The compromised eMudhra certificates case exposes exactly that risk: one of the private keys this Indian certificate authority used to sign SSL certificates turned out to be, literally, the number 4. Anyone with a decent laptop can factor it in milliseconds and generate a valid certificate for any domain, including your company’s website.

I work in DevOps, and this is where infrastructure as code made all the difference: in the days after the advisory, I spent my time checking what we needed to update, where the patch landed on its own, and where it didn’t come close. Here’s what happened, which versions you need to install right now, and what to do when the hotfix itself refuses to install.

What happened with the compromised eMudhra certificates

The chain of trust in HTTPS depends on certificate authorities signing with keys nobody can reproduce. That security normally relies on the product of enormous prime numbers, dozens of digits long: not even with all the computing power in the world would you break them in a reasonable amount of time.

In eMudhra’s case, eight intermediate certificates turned out to be signed under that same logic, but in reverse: among the keys were numbers as small as 4, 56, and 230. Factoring a number that small is something anyone can do, with a five-line script and without waiting a single second.

With that key in hand, anyone can generate a valid SSL certificate for any domain they want and get a browser, an operating system, or an email client to accept it as legitimate. You could sign an email impersonating a bank, or spin up a website identical to Google’s that any browser would trust. A technical analysis later explained, step by step, how those keys were extracted from public certificates, and the flaw had gone undetected for close to 18 months, despite two independent audits. eMudhra ended up withdrawing from the SSL certificate business shortly after, which gives you an idea of the scale of the issue.

The risk is both technical and a matter of collective trust. It’s the kind of flaw measured by how many people can end up trusting something fake before the entire ecosystem reacts: a phishing campaign signed and verified as if it were legitimate, or a cloned website that the browser can’t tell apart from the real one.

Updating your browser doesn’t fix this on its own. Google Chrome and the other major browsers had already blocked those keys within days — as long as you had the latest version installed. Everything else stays exposed and takes weeks to fully close off:

  • Servers and load balancers with their own root certificate store
  • Operating systems that don’t receive automatic updates
  • Containers built on outdated images
  • Language libraries like Node.js, Go, or Python that bundle their own certificate authorities

What to update: the critical patches in Node.js

Among the advisories that came out that week, the Node.js one hit closest to home. The project released updates for its three active lines (26.x, 24.x, and 22.x), and among the pieces included was blocking eMudhra’s compromised keys in the root certificate store Node ships by default.

Node doesn’t always trust the operating system’s certificate store: unless you explicitly enable the option to use the system store, it ships its own list of trusted authorities bundled inside the binary. That bundled list was the one that needed updating, which is why updating the operating system wasn’t enough if your services were still running on an outdated version of Node.

The same goes for other languages that bundle their own store instead of delegating to the system’s, like Go: each one needs its own patch and its own release schedule, so it’s not enough to just check the Node advisory.

That same batch of security patches included an additional update to the root certificates, which removed 3 eMudhra root certificates as part of the update.

This isn’t the first time Ulises Gascón, open source maintainer, has uncovered something like this: a few months ago he was the one who raised the alarm over a critical vulnerability in React Server Components that forced a response within hours. This time, he also wrote the patch himself that adds eMudhra’s keys to the blocklist, in the pull request that fixes Node’s certificate store, and explained it afterward in language anyone on the team could follow without being a cryptographer.

If you work with Node, check which version each service is running and whether it’s below 26.12.1, 24.22.1, or 22.23.4. Besides the eMudhra blocklist, those same releases include nine other patched vulnerabilities, including a high-severity flaw in Google’s Brotli decoder that can lead to remote code execution. This bug is known as node2shell. Patch the Planet (from OpenAI) offers a fairly detailed report on it, since they were the ones who reported the vulnerability in the first place.

The problem comes when your Node version no longer receives support. If you’re running anything older than version 22, you’re left with two paths, and neither is free — not in time, not in money:

  • Pay for a patched EOL version from a specialized vendor that maintains out-of-support builds with the latest security fixes applied
  • Port the patch yourself onto your version and compile the binary, which requires having someone on the team who knows Node’s source code well, since the patches need adapting — especially if you’re using different versions of OpenSSL

How we inventoried hundreds of cloud services and resources in one morning thanks to infrastructure as code

At Orbitant, and with some of our clients, we have all our infrastructure defined as code: Terraform and OpenTofu for the resources in each environment, ArgoCD with a GitOps repository for everything running on the cluster. No resource exists that someone created by hand from a portal; everything lives in a repository, and if something gets deleted or breaks, it gets recreated automatically because the repository still says it’s supposed to exist.

When the eMudhra advisory broke, I opened several sessions with Claude Code on the Terraform and deployment repositories and had it go through every definition: databases, services, image versions, certificates. The result was a complete inventory of what was affected, without me having to go through service by service checking it by hand.

What would have taken days, if not weeks, before, we resolved this time in one long morning, across hundreds of services and resources. The part that saved me the most time was setting up a monitor for every piece that still didn’t have a patch available: the moment Azure published the updated virtual machine image, I got the alert without having to check it every hour.

Beyond the inventory, what gives the most peace of mind is that all of this is idempotent: if someone deletes something by mistake, or an update goes wrong, all it takes is reapplying what’s in the repository for the infrastructure to return to its defined state. If you need to undo a change, a rollback in the repository sends the entire environment back to the previous commit, with nothing rebuilt by hand.

Technical diagram for Orbitant's blog showing a layered infrastructure architecture (Tooling, Cloud Platform with Terraform/OpenTofu, Identity & Access, and Workloads) connected via CI pipelines and GitOps state to Kubernetes clusters.

If you already automate your CI/CD across multicloud environments without compromising security, you’ll recognize the pattern: most of the value of infrastructure as code isn’t felt day-to-day — it’s felt on the day you need to know, in minutes, what you have to change across your entire infrastructure at once. Once we finally approve a change, the pipeline itself takes care of deploying it without anyone touching anything by hand, just like what happened this time with the pieces that already had a patch ready.

When the hotfix itself won’t install

Infrastructure as code doesn’t solve everything. With one client, when we tried to apply the simplest hotfix (updating the ca-certificates package) we found that it couldn’t be installed: the mirrors for the Debian image we use to build our final images with Packer, deployed across several virtual machines, only worked over HTTP, and the firewall blocks HTTP traffic by security policy.

The most urgent patch of the entire week, the one that needed to go in immediately, got stuck behind a rule meant to protect the system, which ended up blocking a certificate update. Automating deployment guarantees that the code is defined in a repository, but it doesn’t guarantee that it actually runs when a network policy stops it along the way.

Half of the real delays I’ve run into these past few days come from the network: firewalls, proxies, and egress policies nobody had reviewed since they were set up. As of today, we’re still going client by client, checking which mirrors each image uses, because this isn’t going to be the last patch that shows up in a hurry.

If you manage infrastructure on Azure, check now, before you need to, whether your egress rules allow reaching package mirrors over HTTPS, and whether every image you have (built with Packer, for example) is up to date and has had a fresh build done. It’s a ten-minute check that can save you from finding out the day you need to apply a patch against the clock.

What to do if you don’t have infrastructure as code

When your infrastructure isn’t defined as code, every server and every service has been configured by hand over time, and there’s no repository that says what version is running where. Facing an advisory like eMudhra’s, the inventory has to be done by checking machine by machine, work that takes days or weeks instead of one morning. Even so, it can be tackled with a method.

Without infrastructure as code, what works is a manual but orderly process:

  1. Build a real inventory of what’s running and where, server by server and service by service, with the exact version of each runtime and each certificate
  2. Prioritize by exposure: first what receives public internet traffic, then what’s internal
  3. Apply patches in batches, starting with the services that would have the biggest impact if something fails
  4. Document every change in the same place, so next time you don’t have to rebuild the map from scratch

This is something practical: it’s basically what we used to do before having everything in Terraform, and it’s still what I recommend to any team that hasn’t made the jump yet.

If what you want is to stop going through this every time, the migration doesn’t have to happen all at once. The usual path is to stand up mirror environments in parallel and move services over one by one as you define them as code, without touching what already works until the new environment is tested, and along the way you gain the inventory and the monitors that saved us days of manual work this time.

Designing the new environment also takes much less time with AI. When I started mapping out the infrastructure for one of our clients, Claude Code didn’t exist yet, and I relied on Claude as a chat tool. The permissions system, which would have taken me weeks of planning before, I resolved in one morning.

Advisories like eMudhra’s are going to become more frequent, because AI speeds up both the search for flaws and their exploitation. When the next one hits, what will make the difference is whether your infrastructure lets you know in minutes what to touch and where, or whether you have to figure it out from scratch.

Frequently asked questions

How do I know if my certificates are affected by the eMudhra case?

Check your domains’ certification chain and see whether any intermediate certificate was issued by eMudhra. Updated browsers already block the compromised keys, so if your certificate still validates without warnings, it most likely doesn’t depend on those intermediate CAs.

What version of Node.js do I need to install?

Anything at or above 26.12.1, 24.22.1, or 22.23.4, depending on the line you use. Those versions include the eMudhra key block, plus nine other security patches released the same day.

What is infrastructure as code?

It means defining servers, databases, permissions, and certificates in files within a repository, using tools like Terraform or OpenTofu, instead of creating them by hand from the provider’s portal. What’s in the repository is what exists in the cloud: if something gets deleted, it gets recreated. A rollback in the repository returns the infrastructure to its previous state.

Follow our journey building AI agents from the inside

    Newsletter language: