Skip to content

gh-160040: Distrust compromised eMudhra intermediate CA keys (CVE-2026-115557) - #160042

Merged
gpshead merged 14 commits into
python:mainfrom
tiran:ssl-distrust-emudhra-keys
Oct 24, 2026
Merged

gpshead merged 14 commits into
python:mainfrom
tiran:ssl-distrust-emudhra-keys

Conversation

@tiran

@tiran tiran commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Several eMudhra intermediate CA keys were compromised and revoked. As defense in depth, reject any chain containing one of the affected public keys, so connections are blocked even when the root store (OS, container) has not yet dropped the issuing roots or certifi/pip are not updated.

The denylist in Modules/_ssl/distrusted_spki.h matches the DER-encoded SPKI, so cross-signed certificates that reuse a key are blocked too. Mirrors Golang's crypto/x509 change. See https://emudhra.we-have-a-problem.com/.

Several eMudhra intermediate CA keys were compromised and revoked. As defense in depth, reject any chain containing one of the affected public keys, so connections are blocked even when the root store (OS, container) has not yet dropped the issuing roots or certifi/pip are not updated.

The denylist in `Modules/_ssl/distrusted_spki.h` matches the DER-encoded SPKI, so cross-signed certificates that reuse a key are blocked too. Mirrors Golang's [crypto/x509](https://go.dev/cl/851047) change. See https://emudhra.we-have-a-problem.com/.

Signed-off-by: Christian Heimes <christian@python.org>
@tiran
tiran force-pushed the ssl-distrust-emudhra-keys branch from a2f652f to 6275d65 Compare October 21, 2026 15:03
@bedevere-app bedevere-app Bot added the type-feature A feature request or enhancement label Oct 21, 2026
Name the SPKI table struct type and list the const table in the c-analyzer
"should be const" ignore list, so check-c-globals passes. Document the new
verification behavior in What's New for 3.16.

Signed-off-by: Christian Heimes <christian@python.org>

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tiran tiran added type-security A security issue and removed type-feature A feature request or enhancement labels Oct 21, 2026
@nchay1030-star nchay1030-star mentioned this pull request Oct 21, 2026
@read-the-docs-community

read-the-docs-community Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #35322568 | 📁 Comparing 42a0b3e against main (0d35e3b)

  🔍 Preview build  

48 files changed · + 1 added · ± 47 modified

+ Added

± Modified

Comment thread Tools/ssl/emudhra_denylist_check.py Outdated
Signed-off-by: Christian Heimes <christian@python.org>
Comment thread Modules/_ssl.c Outdated
Signed-off-by: Christian Heimes <christian@python.org>
Comment thread Lib/test/certdata/distrusted_intermediate.key Outdated
Comment thread Modules/_ssl/distrusted_spki.h Outdated
Comment thread Lib/test/certdata/distrusted_intermediate.key Outdated
@gpshead gpshead added needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Oct 21, 2026
@tiran
tiran requested review from merwok, vstinner and zware October 24, 2026 05:10
@tiran

tiran commented Oct 24, 2026

Copy link
Copy Markdown
Member Author

PS: I cannot merge the PR myself. "You're not authorized to push to this branch."

@gpshead
gpshead enabled auto-merge (squash) October 24, 2026 05:31
@gpshead gpshead moved this from Todo to In Progress in Release and Deferred blockers 🚫 Oct 24, 2026
@gpshead
gpshead merged commit 7dd8b47 into python:main Oct 24, 2026
56 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @tiran for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12, 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @tiran and @gpshead, I could not cleanly backport this to 3.15 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 7dd8b4736a1419750b94a388e6d158be15836fe6 3.15

@miss-islington-app

Copy link
Copy Markdown

Sorry, @tiran and @gpshead, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 7dd8b4736a1419750b94a388e6d158be15836fe6 3.14

@miss-islington-app

Copy link
Copy Markdown

Sorry, @tiran and @gpshead, I could not cleanly backport this to 3.13 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 7dd8b4736a1419750b94a388e6d158be15836fe6 3.13

@miss-islington-app

Copy link
Copy Markdown

Sorry, @tiran and @gpshead, I could not cleanly backport this to 3.12 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 7dd8b4736a1419750b94a388e6d158be15836fe6 3.12

@miss-islington-app

Copy link
Copy Markdown

Sorry, @tiran and @gpshead, I could not cleanly backport this to 3.11 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker 7dd8b4736a1419750b94a388e6d158be15836fe6 3.11

@gpshead

gpshead commented Oct 24, 2026

Copy link
Copy Markdown
Member

backports coming

@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160568 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 24, 2026
@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160569 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 24, 2026
@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160570 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Oct 24, 2026
@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160571 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Oct 24, 2026
@bedevere-app

bedevere-app Bot commented Oct 24, 2026

Copy link
Copy Markdown

GH-160572 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.11 only security fixes label Oct 24, 2026
gpshead added a commit that referenced this pull request Oct 24, 2026
…CVE-2026-115557) (GH-160042) (#160568)

The ssl module now rejects TLS certificate chains that contain any of a set of
compromised eMudhra intermediate CA keys.  This is an extraordinary measure and
a last line of defense: removing trust is primarily the job of the platform root
store, and the built-in denylist only blocks connections while that update has
not yet reached the OS, a container image, or a bundled trust store in various
Python packages.  Entries are added to the denylist only under a very high
threshold.

The denylist matches on the public key (the SHA-256 digest of the RFC-5280
SubjectPublicKeyInfo), so it also covers the cross-signed certificates that
reuse one of the distrusted keys.

---------




(cherry picked from commit 7dd8b47)

Co-authored-by: Christian Heimes <christian@python.org>
gpshead added a commit that referenced this pull request Oct 24, 2026
…CVE-2026-115557) (GH-160042) (#160569)

The ssl module now rejects TLS certificate chains that contain any of a set of
compromised eMudhra intermediate CA keys.  This is an extraordinary measure and
a last line of defense: removing trust is primarily the job of the platform root
store, and the built-in denylist only blocks connections while that update has
not yet reached the OS, a container image, or a bundled trust store in various
Python packages.  Entries are added to the denylist only under a very high
threshold.

The denylist matches on the public key (the SHA-256 digest of the RFC-5280
SubjectPublicKeyInfo), so it also covers the cross-signed certificates that
reuse one of the distrusted keys.

---------




(cherry picked from commit 7dd8b47)

Co-authored-by: Christian Heimes <christian@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.