File CVE-2019-5010-null-defer-x509-cert-DOS.patch of Package python (Revision 7c7532457b948cc36e86ff51d95885bc)
Currently displaying revision 7c7532457b948cc36e86ff51d95885bc , Show latest
61
1
From 280917872027ee991416d2623fc16ff1eed48f50 Mon Sep 17 00:00:00 2001
2
From: Christian Heimes <christian@python.org>
3
Date: Tue, 15 Jan 2019 23:47:42 +0100
4
Subject: [PATCH] bpo-35746: Fix segfault in ssl's cert parser (GH-11569)
5
6
Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL
7
distribution points with empty DP or URI correctly. A malicious or buggy
8
certificate can result into segfault.
9
10
Signed-off-by: Christian Heimes <christian@python.org>
11
12
https://bugs.python.org/issue35746
13
(cherry picked from commit a37f52436f9aa4b9292878b72f3ff1480e2606c3)
14
15
Co-authored-by: Christian Heimes <christian@python.org>
16
---
17
Lib/test/talos-2019-0758.pem | 22 +++++++++++++++++++
18
Lib/test/test_ssl.py | 22 +++++++++++++++++++
19
.../2019-01-15-18-16-05.bpo-35746.nMSd0j.rst | 3 +++
20
Modules/_ssl.c | 4 ++++
21
4 files changed, 51 insertions(+)
22
create mode 100644 Lib/test/talos-2019-0758.pem
23
create mode 100644 Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst
24
25
--- a/Lib/test/test_ssl.py
26
+++ b/Lib/test/test_ssl.py
27
28
}
29
)
30
31
+ def test_parse_cert_CVE_2019_5010(self):
32
+ p = ssl._ssl._test_decode_cert(TALOS_INVALID_CRLDP)
33
+ if support.verbose:
34
+ sys.stdout.write("\n" + pprint.pformat(p) + "\n")
35
+ self.assertEqual(
36
+ p,
37
+ {
38
+ 'issuer': (
39
+ (('countryName', 'UK'),), (('commonName', 'cody-ca'),)),
40
+ 'notAfter': 'Jun 14 18:00:58 2028 GMT',
41
+ 'notBefore': 'Jun 18 18:00:58 2018 GMT',
42
+ 'serialNumber': '02',
43
+ 'subject': ((('countryName', 'UK'),),
44
+ (('commonName',
45
+ 'codenomicon-vm-2.test.lal.cisco.com'),)),
46
+ 'subjectAltName': (
47
+ ('DNS', 'codenomicon-vm-2.test.lal.cisco.com'),),
48
+ 'version': 3
49
+ }
50
+ )
51
+
52
def test_parse_cert_CVE_2013_4238(self):
53
p = ssl._ssl._test_decode_cert(NULLBYTECERT)
54
if support.verbose:
55
--- /dev/null
56
+++ b/Misc/NEWS.d/next/Security/2019-01-15-18-16-05.bpo-35746.nMSd0j.rst
57
58
+[CVE-2019-5010] Fix a NULL pointer deref in ssl module. The cert parser did
59
+not handle CRL distribution points with empty DP or URI correctly. A
60
+malicious or buggy certificate can result into segfault.
61