Skip to content

Refuse TLS chains containing the distrusted eMudhra intermediates - #979

Open
shrutiburman wants to merge 1 commit into
mainfrom
distrust-emudhra-intermediates
Open

shrutiburman wants to merge 1 commit into
mainfrom
distrust-emudhra-intermediates

Conversation

@shrutiburman

@shrutiburman shrutiburman commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

What

Ports the twilio-java distrust-emudhra-intermediates check to twilio-python. A connection is refused if any certificate in its TLS chain has an SPKI SHA-256 hash among the 8 distrusted intermediates (same list as Go 1.27.3 / 1.26.10, CVE-2026-111943, golang/go#82345).

  • New twilio/http/distrusted_intermediates.py: DistrustedIntermediatesAdapter and mount_distrusted_intermediates_check(session).
  • TwilioHttpClient and ValidationClient apply it by default. A custom requests session has to opt in (README section added).
  • Python 3.7–3.9 can't read the chain from the standard library, so setup.py adds pyOpenSSL for python_version < "3.10".

Behaviour differs by Python version

  • 3.10+: checks the verified chain (root included).
  • 3.7–3.9: checks the chain the server sent (usually no root), as the Java SDK does.
  • If a chain can't be read, the check is skipped with a one-time warning.

@shrutiburman

shrutiburman commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor Author

locally tested with one blacklisted cert-
image

@twilio-dx
twilio-dx force-pushed the distrust-emudhra-intermediates branch from 42dd6e0 to d9531f9 Compare October 21, 2026 11:32
@twilio-dx
twilio-dx force-pushed the distrust-emudhra-intermediates branch from d9531f9 to 059886b Compare October 21, 2026 11:42
sudhirnarayana

This comment was marked as resolved.

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants