Python.org CPython X509 certificate parsing denial-of-service vulnerability
Python's X509 certificate parser dereferences a NULL pointer when a certificate contains a DistributionPoint extension with both distributionPoint and cRLIssuer fields blank. An attacker who can present a trusted certificate with this malformed extension can crash any Python process that calls getpeercert() during TLS.
Originally disclosed on Cisco Talos
An exploitable denial-of-service vulnerability exists in the X509 certificate parser of Python.org Python 2.7.11 / 3.6.6. A specially crafted X509 certificate can cause a NULL pointer dereference, resulting in a denial of service.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely, the code dereferences dp->distpoint without checking whether the distributionPoint field is present, so a certificate with an empty distributionPoint and cRLIssuer causes a NULL pointer dereference.
Impact
A trusted attacker could crash a Python TLS client or server, causing a denial of service; untrusted certificates are rejected before the vulnerable code runs.
What the attacker needed
A certificate trusted by the victim; victim calls getpeercert()
The fix
The vendor patched the issue on the same day it was disclosed.
How it was found
- Obtain a certificate trusted by the victim that contains a DistributionPoint extension with blank distributionPoint and cRLIssuer fields.
- Present this certificate during a TLS handshake to a Python client or server that calls getpeercert().
- The handshake completes, then getpeercert() parses the certificate and crashes the process.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a program checks a TLS certificate, it reads fields like the certificate revocation list distribution point. Python assumed this field would always be valid, but a malformed certificate can leave it empty, causing Python to crash. An attacker needs a certificate that the victim already trusts to trigger this.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.