FIPS OpenSSL crashes Python2 hashlib
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python2.7 (Ubuntu) |
Triaged
|
High
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Marc Deslauriers | ||
Bionic |
Fix Released
|
Medium
|
Marc Deslauriers | ||
Cosmic |
Won't Fix
|
Undecided
|
Unassigned | ||
Disco |
Fix Released
|
Medium
|
Marc Deslauriers | ||
Eoan |
Won't Fix
|
High
|
Unassigned | ||
python3.5 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
Xenial |
Fix Released
|
Medium
|
Marc Deslauriers | ||
Bionic |
Invalid
|
Undecided
|
Unassigned | ||
Cosmic |
Invalid
|
Undecided
|
Unassigned | ||
Disco |
Invalid
|
Undecided
|
Unassigned | ||
Eoan |
Invalid
|
Undecided
|
Unassigned |
Bug Description
If Ubuntu/Canonical's FIPS-compliant OpenSSL is initialized with SSL_library_init, then Python2's hashlib bindings for MD5 can trigger a SIGSEGV via a NULL pointer dereference (if calling the .update method) or a SIGABRT (if passing input to the constructor or passing no input and invoking the .final method). This happens if, for example, PyOpenSSL is imported before hashlib.
Canonical's FIPS patches for OpenSSL introduce some odd behavior that arguably should be revisited, but the (TL;DR) core bug is that Python2 hashlib doesn't properly check the return value of EVP_DigestInit, preventing hashlib from falling back to it's internal MD5 implementation and instead setting things up for use of the MD5 context to trigger SIGSEGV or SIGABRT.
Python3 correctly checks the return value, so the fix is to backport the relevant code into Python2 (see python2.
See attached good.py and bad.py files which exhibit the import order-dependent crashing issue. See attached fips-md5-
I discovered this bug investigating an issue with the third-party apt-boto-s3 package. See https:/
Note that this bug effects Splunk, Inc, which has a corporate Ubuntu Advantage license. My login account is attached to a different, single-seat license.
CVE References
Changed in python3.5 (Ubuntu Bionic): | |
status: | New → Invalid |
Changed in python3.5 (Ubuntu Cosmic): | |
status: | New → Invalid |
Changed in python3.5 (Ubuntu Disco): | |
status: | New → Invalid |
Changed in python3.5 (Ubuntu Eoan): | |
status: | New → Invalid |
Changed in python3.5 (Ubuntu Xenial): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in python2.7 (Ubuntu Xenial): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in python2.7 (Ubuntu Bionic): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
importance: | Undecided → Medium |
status: | New → In Progress |
Changed in python2.7 (Ubuntu Cosmic): | |
status: | New → Won't Fix |
Changed in python2.7 (Ubuntu Disco): | |
assignee: | nobody → Marc Deslauriers (mdeslaur) |
importance: | Undecided → Medium |
status: | New → In Progress |
Thanks for bringing this up. The FIPS team is aware of it and will address this.