<The eMudhra/emSign CA Compromise: Why Bumping certifi Alone Doesn't Fix pip or uv
In October 2026, eMudhra disclosed that private keys tied to eight of its intermediate CA certificates had been generated with insufficient randomness, effectively compromising them. Browsers responded by pulling trust from the affected emSign roots, and the Python Software Foundation pushed an advisory telling Python developers to update their tooling, not just their dependencies.
If all you did was run pip install --upgrade certifi inside your project's virtual environment, you have not fixed this. Here's exactly why, and what actually closes the gap.
What happened
An intermediate CA's private key being guessable — not stolen, but mathematically predictable because of weak randomness during generation — means anyone who can also intercept or redirect your network traffic can mint a certificate for any domain that your system will trust as if it came from a real certificate authority. That is a man-in-the-middle setup for HTTPS, including the HTTPS connections your build tools and package managers make every time they resolve and download a dependency.
certifi 2026.10.19 removed trust for the affected emSign root(s) while restoring the unaffected ones, so legitimate emSign-signed sites keep working. But certifi is just a list of trusted root certificates. The code that actually uses that list — pip, uv, your HTTP client, your OS — is where the fix has to land.
The part everyone misses: pip vendors its own certifi
pip does not import certifi from your project's environment when it talks to PyPI. It ships an internal, frozen copy of certifi bundled inside its own source tree, under pip._vendor.certifi. That copy is pinned at release time and travels with whatever pip version you have installed — it has nothing to do with whatever certifi version pip show certifi reports for your project.
Run this to see the split for yourself:
python -m pip show certifi
python -c "import pip._vendor.certifi as c; print(c.where())"
python -c "import certifi; print(certifi.where())"On an affected system, the second and third commands point at two completely different files. The second is the bundle pip itself uses to verify the TLS certificate of pypi.org while it resolves and downloads your dependencies. The third is whatever your project installed for your own code to use. Upgrading the third does nothing to the second.
That is why the official fix is pip 26.2.2 or later, not "any pip with a newer certifi sitting next to it in site-packages." 26.2.2 is the release that actually ships the corrected, trimmed vendored bundle.
The versions that matter
- pip 26.2.2+ — bundles the corrected vendored certifi pip uses for its own network calls
- certifi 2026.10.19+ — the standalone package, for your own application's HTTP calls (requests, httpx, boto3, and friends)
- uv 0.13.6+ — uv has its own TLS stack and needed its own patched release, separate from pip entirely
Having certifi 2026.10.19 installed in a virtualenv while pip is still on 26.1.x, or while uv predates its patch, leaves the exact same exposure pip was supposed to close — just one layer up the toolchain.
Why your lockfile makes this worse
If your project pins certifi through a lockfile — uv.lock, a hash-pinned requirements.txt, a Poetry lock — that lockfile recorded the exact version and hash of certifi that was current the last time you ran the resolver. Re-running pip install -r requirements.txt or uv sync against an old lockfile reinstalls that old, vulnerable certifi on purpose. That is the entire point of a lockfile: reproduce exactly what was there before.
Upgrading certifi by hand on your own laptop doesn't touch CI, doesn't touch a teammate's machine, and doesn't touch a Docker image rebuilt from a cached layer. All three will keep resolving the old pinned version until the lockfile itself gets regenerated.
The actual fix, in order
# 1. Confirm what you're currently running
python -m pip --version
python -c "import ensurepip; print(ensurepip.version())"
# 2. Upgrade pip itself first -- this is the step people skip
python -m pip install --upgrade pip
# 3. Upgrade the standalone certifi your own code imports
python -m pip install --upgrade "certifi>=2026.10.19"
# 4. Upgrade uv if you use it
uv self update
uv --version # confirm the patched version landed
# 5. Regenerate the lockfile -- don't hand-edit the pin
uv lock --upgrade-package certifi
# or, with pip-tools:
pip-compile --upgrade-package certifi requirements.in
# 6. Rebuild Docker images from scratch -- a cached layer keeps the old bundle
docker build --pull --no-cache -t myapp:ca-update .Look closely at step 1's second command. ensurepip.version() reports the pip version baked into your interpreter's seed install, separate from whatever you have upgraded pip to inside any single virtualenv. If you create new virtualenvs with python -m venv, a stale ensurepip seed quietly reintroduces the old pip — and its old vendored certifi — into every new environment you build, even after you think you've fixed this everywhere.
Verifying the fix actually landed
This script does not depend on which exact root got pulled. It just confirms your environment is using the certifi bundle you think it is, and how many CAs it currently trusts, so you have a real before/after to compare:
import certifi
import pathlib
import ssl
bundle_path = pathlib.Path(certifi.where())
print(f"certifi bundle path : {bundle_path}")
print(f"bundle file size : {bundle_path.stat().st_size} bytes")
print(f"bundle last modified: {bundle_path.stat().st_mtime}")
ctx = ssl.create_default_context(cafile=certifi.where())
ca_certs = ctx.get_ca_certs()
print(f"CA certificates loaded: {len(ca_certs)}")Run it before and after the upgrade, in the same environment. The bundle path's modification time and the trusted-CA count should both change once the new certifi actually lands. If they don't move, something in your install order didn't take — usually a cached wheel, a stale ensurepip seed, or a lockfile you forgot to regenerate.
Takeaway
A CA compromise is not a "bump one dependency" problem when the tool managing your dependencies carries its own hidden copy of the exact thing that broke. For this one: upgrade pip itself, upgrade certifi for your own code, upgrade uv if you use it, and regenerate every lockfile that pins any of them — in that order, because skipping the lockfile step undoes everything else you just did.
Read the full upgrade checklist on the blog for CI/CD- and container-specific steps.

Experienced DevOps Engineer proficient in Python, Docker, Kubernetes, CI/CD, and cloud technologies. Specialized in automating processes and building scalable infrastructure for seamless development and deployment.


