Moderate severityNVD Advisory· Published Sep 16, 2013· Updated Apr 29, 2026
CVE-2013-4183
CVE-2013-4183
Description
The clear_volume function in LVMVolumeDriver driver in OpenStack Cinder 2013.1.1 through 2013.1.2 does not properly clear data when deleting a snapshot, which allows local users to obtain sensitive information via unspecified vectors.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
cinderPyPI | < 7.0.0a0 | 7.0.0a0 |
Affected products
2Patches
20ee31073c5cbEnable zero the snapshot when delete snapshot in LVMVolumeDriver
2 files changed · +31 −9
cinder/tests/test_volume.py+24 −1 modified@@ -1439,7 +1439,7 @@ def test_delete_busy_volume(self): self.stubs.Set(self.volume.driver, '_volume_not_present', lambda x: False) self.stubs.Set(self.volume.driver, '_delete_volume', - lambda x, y: False) + lambda x: False) # Want DriverTestCase._fake_execute to return 'o' so that # volume.driver.delete_volume() raises the VolumeIsBusy exception. self.output = 'o' @@ -1490,6 +1490,29 @@ def test_convert_blocksize_option(self): self.assertEquals(bs, '1M') self.assertEquals(count, 1024) + def test_clear_volume(self): + configuration = conf.Configuration(fake_opt, 'fake_group') + configuration.volume_clear = 'zero' + configuration.volume_clear_size = 0 + lvm_driver = lvm.LVMVolumeDriver(configuration=configuration) + self.stubs.Set(lvm_driver, '_copy_volume', lambda *a, **kw: True) + + fake_volume = {'name': 'test1', + 'volume_name': 'test1', + 'id': 'test1'} + + # Test volume has 'size' field + volume = dict(fake_volume, size='123') + self.assertEquals(True, lvm_driver.clear_volume(volume)) + + # Test volume has 'volume_size' field + volume = dict(fake_volume, volume_size='123') + self.assertEquals(True, lvm_driver.clear_volume(volume)) + + # Test volume without 'size' field and 'volume_size' field + volume = dict(fake_volume) + self.assertEquals(None, lvm_driver.clear_volume(volume)) + class ISCSITestCase(DriverTestCase): """Test Case for ISCSIDriver"""
cinder/volume/drivers/lvm.py+7 −8 modified@@ -162,7 +162,7 @@ def _volume_not_present(self, volume_name): return True return False - def _delete_volume(self, volume, size_in_g): + def _delete_volume(self, volume): """Deletes a logical volume.""" # zero out old volumes to prevent data leaking between users # TODO(ja): reclaiming space should be done lazy and low priority @@ -218,19 +218,18 @@ def delete_volume(self, volume): if (out[0] == 'o') or (out[0] == 'O'): raise exception.VolumeIsBusy(volume_name=volume['name']) - self._delete_volume(volume, volume['size']) + self._delete_volume(volume) def clear_volume(self, volume): """unprovision old volumes to prevent data leaking between users.""" vol_path = self.local_path(volume) - size_in_g = volume.get('size') - size_in_m = self.configuration.volume_clear_size - - if not size_in_g: + size_in_g = volume.get('size', volume.get('volume_size', None)) + if size_in_g is None: LOG.warning(_("Size for volume: %s not found, " - "skipping secure delete.") % volume['name']) + "skipping secure delete.") % volume['id']) return + size_in_m = self.configuration.volume_clear_size if self.configuration.volume_clear == 'none': return @@ -275,7 +274,7 @@ def delete_snapshot(self, snapshot): # TODO(yamahata): zeroing out the whole snapshot triggers COW. # it's quite slow. - self._delete_volume(snapshot, snapshot['volume_size']) + self._delete_volume(snapshot) def local_path(self, volume): # NOTE(vish): stops deprecation warning
68c597e26b56Enable zero the snapshot when delete snapshot in LVMVolumeDriver
2 files changed · +42 −9
cinder/tests/test_volume.py+35 −1 modified@@ -24,6 +24,7 @@ import os import mox +from oslo.config import cfg import shutil import tempfile @@ -43,11 +44,16 @@ from cinder.tests.image import fake as fake_image from cinder.volume import configuration as conf from cinder.volume import driver +from cinder.volume.drivers import lvm from cinder.volume import iscsi QUOTAS = quota.QUOTAS FLAGS = flags.FLAGS +fake_opt = [ + cfg.StrOpt('fake_opt', default='fake', help='fake opts') +] + class VolumeTestCase(test.TestCase): """Test Case for volumes.""" @@ -907,7 +913,7 @@ def test_delete_busy_volume(self): self.stubs.Set(self.volume.driver, '_volume_not_present', lambda x: False) self.stubs.Set(self.volume.driver, '_delete_volume', - lambda x, y: False) + lambda x: False) # Want DriverTestCase._fake_execute to return 'o' so that # volume.driver.delete_volume() raises the VolumeIsBusy exception. self.output = 'o' @@ -920,6 +926,34 @@ def test_delete_busy_volume(self): self.volume.driver.delete_volume({'name': 'test1', 'size': 1024}) +class LVMVolumeDriverTestCase(DriverTestCase): + """Test case for VolumeDriver""" + driver_name = "cinder.volume.drivers.lvm.LVMVolumeDriver" + + def test_clear_volume(self): + configuration = conf.Configuration(fake_opt, 'fake_group') + configuration.volume_clear = 'zero' + configuration.volume_clear_size = 0 + lvm_driver = lvm.LVMVolumeDriver(configuration=configuration) + self.stubs.Set(lvm_driver, '_copy_volume', lambda *a, **kw: True) + + fake_volume = {'name': 'test1', + 'volume_name': 'test1', + 'id': 'test1'} + + # Test volume has 'size' field + volume = dict(fake_volume, size='123') + self.assertEquals(True, lvm_driver.clear_volume(volume)) + + # Test volume has 'volume_size' field + volume = dict(fake_volume, volume_size='123') + self.assertEquals(True, lvm_driver.clear_volume(volume)) + + # Test volume without 'size' field and 'volume_size' field + volume = dict(fake_volume) + self.assertEquals(None, lvm_driver.clear_volume(volume)) + + class ISCSITestCase(DriverTestCase): """Test Case for ISCSIDriver""" driver_name = "cinder.volume.drivers.lvm.LVMISCSIDriver"
cinder/volume/drivers/lvm.py+7 −8 modified@@ -125,7 +125,7 @@ def _volume_not_present(self, volume_name): return True return False - def _delete_volume(self, volume, size_in_g): + def _delete_volume(self, volume): """Deletes a logical volume.""" # zero out old volumes to prevent data leaking between users # TODO(ja): reclaiming space should be done lazy and low priority @@ -180,19 +180,18 @@ def delete_volume(self, volume): if (out[0] == 'o') or (out[0] == 'O'): raise exception.VolumeIsBusy(volume_name=volume['name']) - self._delete_volume(volume, volume['size']) + self._delete_volume(volume) def clear_volume(self, volume): """unprovision old volumes to prevent data leaking between users.""" vol_path = self.local_path(volume) - size_in_g = volume.get('size') - size_in_m = self.configuration.volume_clear_size - - if not size_in_g: + size_in_g = volume.get('size', volume.get('volume_size', None)) + if size_in_g is None: LOG.warning(_("Size for volume: %s not found, " - "skipping secure delete.") % volume['name']) + "skipping secure delete.") % volume['id']) return + size_in_m = self.configuration.volume_clear_size if self.configuration.volume_clear == 'none': return @@ -237,7 +236,7 @@ def delete_snapshot(self, snapshot): # TODO(yamahata): zeroing out the whole snapshot triggers COW. # it's quite slow. - self._delete_volume(snapshot, snapshot['volume_size']) + self._delete_volume(snapshot) def local_path(self, volume): # NOTE(vish): stops deprecation warning
Vulnerability mechanics
Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- rhn.redhat.com/errata/RHSA-2013-1198.htmlnvdPatchVendor Advisory
- github.com/advisories/GHSA-q3rw-wcj6-8cjfghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2013-4183ghsaADVISORY
- bugs.launchpad.net/cinder/+bug/1198185nvdWEB
- github.com/openstack/cinder/commit/0ee31073c5cb432a9cdd2648e99aa802b0ed0a17ghsaWEB
- github.com/openstack/cinder/commit/68c597e26b5659a036a7a937622e539bac102308ghsaWEB
- github.com/pypa/advisory-database/tree/main/vulns/cinder/PYSEC-2013-35.yamlghsaWEB
- rhn.redhat.com/errata/RHSA-2013-1198.htmlghsaWEB
- www.ubuntu.com/usn/USN-2005-1ghsaWEB
- www.ubuntu.com/usn/USN-2005-1nvd
News mentions
0No linked articles in our index yet.