Skip to content

Distrust the compromised eMudhra certificates - #127318

Merged
Algunenano merged 4 commits into
masterfrom
distrust-emudhra-certificates
Oct 23, 2026
Merged

Algunenano merged 4 commits into
masterfrom
distrust-emudhra-certificates

Conversation

@alexey-milovidov

@alexey-milovidov alexey-milovidov commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Hardening in response to the eMudhra incident: the private keys of eight eMudhra intermediate CAs, issued in 2025, can be recovered from their certificates.

There is no security issue for ClickHouse in typical use cases, and this PR is merely hardening. The affected intermediates have never been logged to Certificate Transparency and are already revoked; browsers and operating system vendors (Chrome, Firefox, Apple, Microsoft) have already blocked them, and ClickHouse uses the trust store of the operating system by default.

The PR does two things:

  1. Distrust the compromised certificates regardless of the trust store. Any certificate chain that contains one of the eight intermediates, or one of the roots that issued or cross-signed them (emSign Root TLS CA - G3, emSign Root CS CA - G3, emSign ECC Root CA - G3), is rejected with certificate revoked, even if the trust store of the operating system (or a configured caConfig) still contains them, e.g. on a system that has not been updated. Keys are matched by the SHA-256 of the SubjectPublicKeyInfo, the same way as Chrome's CRLSet, so the certificates of the same keys cross-signed by Sectigo AAA Certificate Services are rejected as well. The check is done in Poco::Net::SSLManager::verifyCallback, so it applies to all TLS connections made through Poco (HTTP/S3/URL clients, the native protocol, interserver communication, Keeper, client certificates on the server side). Libraries that create their own OpenSSL contexts (e.g. librdkafka, libpq) are not covered. emSign Root CA - G1 is unaffected and stays trusted, as in Chrome, Mozilla, gRPC and certifi. All fingerprints were checked against the certificates published at https://emudhra.we-have-a-problem.com/.

  2. Update the bundle of CA certificates embedded into the binary (contrib/grpc/etc/roots.pem) from the Chromium root store, following upstream gRPC. This removes emSign ECC Root CA - G3, along with the other recent Chromium root store changes. Note that this bundle is not used in typical scenarios: it is only a fallback for when no CA certificates can be found on the filesystem, e.g. in a container built "from scratch".

Related: https://emudhra.we-have-a-problem.com/
Related: ClickHouse/grpc#46
Related: grpc/grpc#43699
Related: certifi/python-certifi#440

Changelog category (leave one):

  • Improvement

Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):

Hardening: certificate chains containing the compromised eMudhra intermediate CAs or the roots that issued them (emSign Root TLS CA - G3, emSign ECC Root CA - G3) are rejected even if the trust store of the operating system still trusts them. The CA certificates embedded into the binary (used only when the system has none) are updated from the Chromium root store. There is no security issue in typical use cases.

🤖 Generated with Claude Code


Workflow [PR]
Sync PR [sync-upstream/pr/127318]

Version info

  • Merged into: 26.11.1.646-master (included in 26.11 and later)
  • Backported to: 26.10.2.96, 26.9.26.9, 26.8.35.8, 26.7.38.16, 26.3.61.3

The private keys of eight eMudhra intermediate CAs issued in 2025 can be recovered
from their certificates. Reject any certificate chain that contains one of them, or
one of the roots that issued or cross-signed them (`emSign Root TLS CA - G3`,
`emSign Root CS CA - G3`, `emSign ECC Root CA - G3`), regardless of the trust store
it was built from, including the trust store of the operating system. The keys are
identified by the SHA-256 of their `SubjectPublicKeyInfo`, so the cross-signed
certificates of the same keys (issued by Sectigo `AAA Certificate Services`) are
rejected as well. The check is done in `Poco::Net::SSLManager::verifyCallback`.

Also update the CA certificates embedded into the binary (`contrib/grpc/etc/roots.pem`)
from the Chromium root store, which removes `emSign ECC Root CA - G3`.

Related: https://emudhra.we-have-a-problem.com/
Related: ClickHouse/grpc#46
Related: grpc/grpc#43699

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@clickhouse-gh

clickhouse-gh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [a815ff7]

Summary: ✅


AI Review

Summary

The PR adds public-key distrust checks for the compromised eMudhra CAs and refreshes the embedded CA bundle. One previously reported coverage gap remains: outbound Keeper connections bypass the check even with certificate verification enabled. The author explicitly deferred that work; no new inline findings were identified.

Findings

⚠️ Majors

  • base/poco/NetSSL_OpenSSL/src/SSLManager.cpp:207 The promised Keeper coverage is incomplete. [dismissed by author -- https://github.com/Distrust the compromised eMudhra certificates #127318#discussion_r4347339685] The pinned NuRaft asio_rpc_client replaces the callback inherited from Poco with verify_certificate, which returns preverified without checking the distrust list. A stale system store or configured caConfig can therefore still accept the compromised chains on outgoing Raft connections. Deferring callback unification leaves this behavior present despite the PR description explicitly claiming Keeper coverage. Preserve the distrust check through NuRaft's callback, or explicitly exclude outgoing Keeper Raft connections from the stated coverage.
Tests
  • ⚠️ If Keeper remains in scope, add a focused outbound verification test exercising NuRaft's callback replacement. The new trusted-root unit test does not exercise that path. A standalone harness linking the PR's actual checkDistrustedCertificate rejected all 19 affected certificates and preserved the unaffected root; with a controlled stale trust store, all 14 published incident chains were rejected with X509_V_ERR_CERT_REVOKED when the distrust callback was retained and accepted when it was replaced by NuRaft's pass-through behavior.
Missing context / blind spots
  • ⚠️ The local harness used system OpenSSL and reproduced the callback behavior without running ClickHouse or Keeper. The checkout has no configured build, and full CI builds/tests remain pending at the reviewed head. Completed unit and integration jobs would close the build/runtime validation gap.
Final Verdict

Status: ⚠️ Request changes — either implement and test the advertised outbound Keeper protection, or narrow the coverage claim to acknowledge the deliberately deferred path. The intentional behavior when certificate verification is disabled is accepted and is not retained as a finding.

@clickhouse-gh clickhouse-gh Bot added pr-improvement Pull request with some product improvements submodule changed At least one submodule changed in this PR. labels Oct 22, 2026
@clickhouse-gh clickhouse-gh Bot added the comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. label Oct 22, 2026
@clickhouse-gh

clickhouse-gh Bot commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Build profile diff (arm_release)

Commit a815ff7f3d44da32a7c7087438c611b23d1e83fc was not compared: the CI logs cluster did not answer (exception 241, code 500: { "meta": [ { "name": "file", "type": "LowCardinality(String)" …).

See the job log for details.

@Algunenano Algunenano self-assigned this Oct 22, 2026
@Algunenano Algunenano added the pr-must-backport Pull request should be backported intentionally. Use this label with great care! label Oct 22, 2026
The updated root store embeds 99 certificates, so lower the threshold in
`test_embedded_ca_certificates` from 100 to 50.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Algunenano

Copy link
Copy Markdown
Member

Updated the submodule after merging the PR and fixed the test (it was expecting to have a large number of certificates). I've also added the tag to backport because although it's technically a breaking change I think its benefits far outweigh the possible risks and incompatibilities.

@Algunenano
Algunenano added this pull request to the merge queue Oct 23, 2026
Merged via the queue into master with commit c4ce7c5 Oct 23, 2026
179 checks passed
@Algunenano
Algunenano deleted the distrust-emudhra-certificates branch October 23, 2026 10:31
@robot-ch-test-poll3 robot-ch-test-poll3 added the pr-synced-to-cloud The PR is synced to the cloud repo label Oct 23, 2026
@robot-ch-test-poll2 robot-ch-test-poll2 added the pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR label Oct 23, 2026
clickhouse-gh Bot added a commit that referenced this pull request Oct 23, 2026
Backport #127318 to 26.10: Distrust the compromised eMudhra certificates
robot-clickhouse added a commit that referenced this pull request Oct 23, 2026
Cherry pick #127318 to 26.3: Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Removed the integration test for the embedded CA certificates, which stable-25.8 doesn't have; the distrust check and grpc bump applied cleanly.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Dropped the integration test for the embedded CA certificate fallback, which antalya-25.8 doesn't have; the Poco distrust check, gtest and grpc bump applied cleanly.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Dropped the integration test change because stable-26.3 doesn't have `test_embedded_ca_certificates` or the embedded CA fallback; the rest of the PR applied unchanged.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Dropped the threshold change to test_embedded_ca_certificates/test.py, which doesn't exist on antalya-26.3; the rest of the PR applied cleanly.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Removed the modify/delete-conflicted integration test, which doesn't exist on antalya-26.6; the rest of the PR (distrust check, gtest, grpc CA bundle bump) applied without conflicts.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Dropped the integration test change because stable-26.8 has neither the test nor the embedded-CA fallback it tests; everything else applied cleanly.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Deleted the integration test for the built-in CA certificates fallback, which antalya-26.8 doesn't have; the distrust check, its unit test and the grpc update are kept as in the source PR.
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Antalya 25.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Antalya 26.3 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 26, 2026
Stable 25.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Stable 26.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Stable 26.3 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Antalya 26.6 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Antalya 26.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Stable 25.3 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 27, 2026
Stable 24.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 28, 2026
Stable 24.3 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
zvonand added a commit to Altinity/ClickHouse that referenced this pull request Oct 29, 2026
Stable 23.8 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
mkmkme added a commit to Altinity/ClickHouse that referenced this pull request Nov 2, 2026
FIPS 25.3 Backport of ClickHouse#127318 - Distrust the compromised eMudhra certificates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp-external-dependencies Third-party deps updates in contrib/, vendored code, and platform base libraries. pr-backports-created Backport PRs are successfully created, it won't be processed by CI script anymore pr-improvement Pull request with some product improvements pr-must-backport Pull request should be backported intentionally. Use this label with great care! pr-must-backport-synced The `*-must-backport` labels are synced into the cloud Sync PR pr-synced-to-cloud The PR is synced to the cloud repo submodule changed At least one submodule changed in this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants