Skip to content

fix(transport): Reject leaked eMudhra intermediate certificates - #6336

Open
runningcode wants to merge 3 commits into
mainfrom
no/distrust-emudhra-intermediates
Open

runningcode wants to merge 3 commits into
mainfrom
no/distrust-emudhra-intermediates

Conversation

@runningcode

@runningcode runningcode commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

📜 Description

Rejects TLS servers that present one of the eight leaked eMudhra intermediate certificates (CVE-2026-111943) in the two places where the SDK opens its own HTTPS connections: the envelope transport (HttpConnection) and the distribution update check (DistributionHttpClient).

How does it work:
The new internal DistrustedCertificates runs right after connect(), once the TLS handshake is done but before any of the request is written. It compares the SHA-256 of each server certificate's public key against the leaked keys, which matches both the eMudhra-issued certificates and their AAA Certificate Services cross-signs. On a match it disconnects and throws SSLPeerUnverifiedException. Since that is an IOException, a blocked envelope is kept in the offline cache and retried later.

💡 Motivation and Context

https://emudhra.we-have-a-problem.com/

Fixes JAVA-783

💚 How did you test it?

DistrustedCertificatesTest checks the matching against the real EM DV TLS CA - G3B cross-signed certificate. HttpConnectionTest mocks the check and verifies it runs after connect() and that a rejected connection never writes the envelope. DistributionHttpClient creates its own connection, so it isn't covered by a dedicated test.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

Out of scope: SpotlightIntegration only talks to a local server, and the HTTP client integrations (sentry-okhttp, Apache, OpenFeign, Ktor, Spring) instrument the app's own clients, which the app has to fix itself.

🤖 Generated with Claude Code

@linear-code

linear-code Bot commented Oct 21, 2026

Copy link
Copy Markdown

JAVA-783

@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/HttpConnection.java

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/HttpConnection.java

@sentry

sentry Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.61.1 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode
runningcode force-pushed the no/distrust-emudhra-intermediates branch from 9099fca to c17d99a Compare October 21, 2026 08:56
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/HttpConnection.java

@runningcode
runningcode force-pushed the no/distrust-emudhra-intermediates branch from c17d99a to fdafbb8 Compare October 22, 2026 16:08
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/HttpConnection.java

}

connection.connect()
DistrustedCertificates.getInstance().verify(connection)

@runningcode runningcode Oct 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right now this is called statically, but we could also put it in SentryOptions and grab it from there but I wanted to avoid making a larger change since this is just for DistributionHttpClient.

requestDetails,
AuthenticatorWrapper.getInstance(),
rateLimiter,
DistrustedCertificates.getInstance());

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as an alternative design i inject the DistrustedCertificates instance making this easier to test/replace.

@runningcode
runningcode marked this pull request as ready for review October 26, 2026 16:57
runningcode and others added 3 commits October 26, 2026 18:02
The private keys of eight eMudhra intermediates can be recovered from their certificates (CVE-2026-111943). Their Sectigo cross-signs chain to AAA Certificate Services, which is trusted on every Android version, so platform trust store updates won't reach every device. The envelope transport and the distribution client now reject servers that present one of these keys, right after the TLS handshake and before any request is written.

Fixes JAVA-783

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Inject the check through HttpConnection's constructor like AuthenticatorWrapper, so its tests can stub it instead of loading the real eMudhra certificate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode force-pushed the no/distrust-emudhra-intermediates branch from fdafbb8 to 099ea84 Compare October 26, 2026 17:02
@github-actions

Copy link
Copy Markdown
Contributor

🚨 Detected changes in high risk code 🚨

High-risk code has higher potential to break the SDK and may be hard to test. To prevent severe bugs, apply the rollout process for releasing such changes and be extra careful when changing and reviewing these files:

  • sentry/src/main/java/io/sentry/transport/HttpConnection.java

@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Oct 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant