Bug 1303486 (CVE-2015-8234)

Summary: CVE-2015-8234 openstack-glance: MD5 used for cryptographic signature verification
Product: [Other] Security Response Reporter: Garth Mollett <gmollett>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED WONTFIX QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: abaron, akscram, alexander.sakhnov, aortega, apevec, apevec, ayoung, bfilippov, chrisw, cyril, dallan, eglynn, fpercoco, gkotton, itamar, jjoyce, jobernar, jonathansteffan, jose.castro.leon, jrusnack, jschluet, karlthered, kbasil, lhh, lpeer, markmc, mburns, mlvov, mmagr, ndipanov, nsantos, rbryant, rk, sclewis, slinaber, srevivo, tdecacqu, yeylon
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-01 02:36:50 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1303487    
Bug Blocks: 1280304    

Description Garth Mollett 2016-02-01 02:34:49 UTC
Daniel P. Berrange reports:

In the OpenStack Liberty release, the Glance project added support for image signature verification.

http://specs.openstack.org/openstack/glance-specs/specs/liberty/image-signing-and-verification-support.html

The verification code was added in the following git commit

https://github.com/openstack/glance/commit/484ef1b40b738c87adb203bba6107ddb4b04ff6e

Unfortunately the design of this signature verification method is flawed by design.

The generalized approach to creating signatures of content is to apply a hash to the content and then encrypt it in some manner. Consider that the signature is defined to use hash=sha256 and cipher=rsa we can describe the signature computation as

signature = rsa(sha256(content))

In the case of verifying a disk image, the content we care about verifying is the complete disk image file. Unfortunately, the glance specification chose *not* to compute the signature against the disk image file. Glance already had an MD5 checksum calculated for the disk image file, so they instead chose to compute the signature against the MD5 checksum instead. ie glance is running

signature = rsa(sha256(md5(disk-image-content)))

This degrades the security of the system to that of the weakest hash, which is obviously MD5 here.