PYSEC-2026-35: cryptography has incomplete DNS name constraint enforcement on peer names

Published Mar 31, 2026
·
Updated

cryptography is a package designed to expose cryptographic primitives and recipes to Python developers. Prior to version 46.0.6, DNS name constraints were only validated against SANs within child certificates, and not the "peer name" presented during each validation. Consequently, cryptography would allow a peer named bar.example.com to validate against a wildcard leaf certificate for .example.com, even if the leaf's parent certificate (or upwards) contained an excluded subtree constraint for bar.example.com. This issue has been patched in version 46.0.6.

Affected Software

1 affected component
pypi/cryptography<46.0.6

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 46.0.6

Event History

Mar 31, 2026
CVE Published
via OSV·02:04 AM
Data Sourced
via OSV·02:04 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which deployments are exposed to this issue?

Deployments using cryptography before version 46.0.6 and validating certificate chains with DNS name constraints may be affected. The described bypass requires a wildcard leaf certificate and an ancestor certificate that excludes the peer's DNS name through an excluded subtree constraint.

2

What does an attacker need to exploit the constraint bypass?

An attacker needs a certificate chain in which a wildcard leaf certificate, such as *.example.com, can match the presented peer name while a parent or higher certificate excludes that specific name, such as bar.example.com. The issue arises because the peer name was not checked against DNS name constraints during validation.

3

Is the default configuration affected?

The available information does not state whether a default configuration uses DNS name constraints or performs the affected validation flow. Exposure depends on use of cryptography before 46.0.6 with certificate chains containing relevant DNS excluded-subtree constraints.

4

What remediation is available?

Upgrade cryptography to version 46.0.6 or later. This version patches DNS name-constraint validation so that the peer name is checked.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203