[Openstack-security] [Bug 1516031] Fix merged to glance (master)
OpenStack Infra
1516031 at bugs.launchpad.net
Wed Jan 27 01:58:32 UTC 2016
Reviewed: https://review.openstack.org/271513
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=eab1567d48a18fa968c7b66c3641dd037da1f84e
Submitter: Jenkins
Branch: master
commit eab1567d48a18fa968c7b66c3641dd037da1f84e
Author: Brianna Poulos <Brianna.Poulos at jhuapl.edu>
Date: Fri Jan 22 15:13:35 2016 -0500
Remove unneeded glance unit test assert calls
The glance_store library now accepts a verifier object for use with
verifying signatures, as a result of a recently merged patch [1].
There are some glance unit tests that do not expect this verifier
object to be passed to the add method of glance_store, and will
therefore fail with a new release of the glance_store library.
This patch removes the assert lines for the tests that will fail,
since it is not necessary for glance to test glance_store in that
way at the glance level.
[1] https://review.openstack.org/#/c/183110/
Change-Id: I404fbc40dafa159a63a6dfee563f05ee80c073dc
Partial-Bug: #1516031
--
You received this bug notification because you are a member of OpenStack
Security, which is subscribed to OpenStack.
https://bugs.launchpad.net/bugs/1516031
Title:
Use of MD5 in OpenStack Glance image signature (CVE-2015-8234)
Status in Glance:
Triaged
Status in OpenStack Security Advisory:
Won't Fix
Status in OpenStack Security Notes:
Fix Released
Bug description:
This have been reported by Daniel P. Berrange:
"
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.
The code where glance verifies the signature is in the
glance/locations.py, the 'set_data' method where is does
result = signature_utils.verify_signature(
self.context, checksum, self.image.extra_properties)
if result:
LOG.info(_LI("Successfully verified signature for image %s"),
self.image.image_id)
The 'checksum' variable is populate by the glance_store driver, but it
is hardcoded to always be md5 in all current glance storage backends:
$ git grep hashlib glance_store/_drivers/ | grep checksum
glance_store/_drivers/filesystem.py: checksum = hashlib.md5()
glance_store/_drivers/rbd.py: checksum = hashlib.md5()
glance_store/_drivers/s3.py: checksum = hashlib.md5()
glance_store/_drivers/s3.py: checksum = hashlib.md5()
glance_store/_drivers/sheepdog.py: checksum = hashlib.md5()
glance_store/_drivers/swift/store.py: checksum =
hashlib.md5()
glance_store/_drivers/vmware_datastore.py: self.checksum =
hashlib.md5()
Since we will soon be shipping OpenStack Liberty release, we need to at least give a security notice to alert our customers to the fact that the signature verification is cryptographically weak/broken. IMHO, it quite likely deserves a CVE though
NB, this is public knowledge as I first became aware of this flawed
design in comments / discussion on a public specification proposed to
implement the same approach in the Nova project.
My suggested way to fix this is to simply abandon the current impl and
re-do it such that it directly computes the signature against the
disk image, and does not use the existing md5 checksum in any way.
Regards,
Daniel
"
Mailing list thread for Nova impl: http://lists.openstack.org/pipermail/openstack-dev/2015-November/079348.html
Nova Spec: https://review.openstack.org/#/c/188874/
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1516031/+subscriptions
More information about the Openstack-security
mailing list