r/Python • Python Software Foundation Staff • Oct 20 '26

News Info for Python users regarding eMudhra / emSign CA certificate security incident

A security incident affecting eMudhra intermediate certificates has required removing the emSign root CA certificate from CA bundles such as β€œcertifi”. It’s important to immediately upgrade the software packages below to at least the versions specified and rebuild container images to fetch the latest system certificates. Failure to do so could result in monster-in-the-middle (MITM) attacks against TLS clients, including python.org and pypi.org .

(1): Advisory mentions 2026.10.18, but 2026.10.19 is recommended for compatibility with unaffected emSign root certificates.

For all existing virtual environments on your system, please upgrade pip and uv to the latest versions.

Please read the full post on discuss.python.org for up-to-date information: https://discuss.python.org/t/information-for-python-users-regarding-emudhra-emsign-ca-certificate-security-incident/109576

166 Upvotes

27 comments sorted by

View all comments

Show parent comment

12

u/d3matt Oct 20 '26

Unless you're running an EOL python... I feel like this deserves an exception to the "we don't support EOL python releases" rule.

8

u/zurtex Oct 21 '26

pip maintainer here, we continue to support Python 3.10 even though the PSF has it as EoL.

LTS redistributors like Red Hat can, and do, devendor pip to provide their own version of certifi. Though I don't know their exact policy here, you'll need to check with each distro.

2

u/Dowlphin Oct 24 '26 edited Oct 24 '26

I am slightly worried about mention of 3.15, 3.14 and 3.13 having been updated, but I got system-installed 3.12 on my Kubuntu 24. (Which rejects manual updates because that could break stuff.) For now I found on the web and added config entries instructing pip (2.4) to use the system certs ("legacy-resolver" I hope is right, "legacy-certs" was rejected), but I have no overview or full grasp of the virtual environments situation. Some info says pip 2.6.6 has been patched, not 2.4.

8

u/zurtex Oct 24 '26

This will tell you where certifi is installed from (replace "pip" with how you normall call pip):

pip debug 2>/dev/null | grep -i "pip._vendor.certifi.where()"

A system store will look something like this:

pip._vendor.certifi.where(): /etc/ssl/certs/ca-certificates.crt

If you are not using a system store, but the Python package, you can check the version like this:

pip debug 2>/dev/null | grep -i "certifi=="

Finally, if you have regular internet access you can run:

for ca in dv ov ev; do for chain in g3b g3c g3b-aaa g3c-aaa; do pip --disable-pip-version-check --no-cache-dir index versions pip --index-url "https://$ca-$chain-emudhra.we-have-a-problem.com/" --retries 0 --timeout 10 -vv; done; done

And you should see errors that say something like CERTIFICATE_VERIFY_FAILED with unable to get local issuer certificate

2

u/Dowlphin Oct 24 '26

Amazing response! πŸ˜ƒ

It is using system certs and the final test does yield verify failures. πŸ‘

Question is, if there is that thing with virtual environments, doesn't that mean that every app I previously installed with pip has outdated certs? Or is the virtual environment only generated (anew) when the app is launched and that gets the updated stuff? Because I might have apps installed that way that connect to the internet. Tartube is definitely one. (For which I had to manually install Deno and I managed to update that one already. Tartube uses yt-dlp. Dunno how it deals with certs from inside a virtual environment. As I said, this complexity makes my head smoke.)

1

u/zurtex Oct 24 '26

If you're using the Python provided by the distro, then venvs should also be seeded with a patched version of pip. You can active any given venv and run that pip command.

2

u/d3matt Oct 21 '26

Dang, it hadn't registered to me that 3.10 was EOL too already. 3.9 is still the default for the EL9 series (trivial to get 3.14, I know...)

I'll definitely be pushing people at the office to bump up.

2

u/zurtex Oct 21 '26

I've not checked, but I am pretty sure EL9 patches pip to use their own certifi, not the one we distribute.

3

u/d3matt Oct 21 '26

Oh neat... the EL python3.9-pip's vendored certifi is patched to look at /etc/pki/tls/certs/ca-bundle.crt for its certificates. My usual mechanism for creating a venv though is to immediately upgrade to the latest pip before installing anything else. This of course switches to the upstream certifi 2026.01.04 which I'm pretty sure includes the bad certs.

2

u/zurtex Oct 21 '26

Correct, if you're using a Python version pip maintainers no longer support (Python 3.9 and below) but your Linux distro does, then you should use the pip distributed by them as they are guaranteeing security, not us.