[Glance] Glance user storage quota bypass #2

Bug #1497984 reported by Alexey Galkin
260
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mirantis OpenStack
Fix Released
Critical
Mike Fedosin
5.1.x
Fix Released
Critical
Alexey Khivin
6.0.x
Fix Released
Critical
Alexey Khivin
6.1.x
Fix Released
Critical
Alexey Khivin
7.0.x
Fix Released
Critical
Mike Fedosin
8.0.x
Fix Released
Critical
Mike Fedosin

Bug Description

Based on https://bugs.launchpad.net/mos/+bug/1414685 , but in fact is a another issue. Only Glance setups configured with user_storage_quota are affected.

Affected:
 All version v1 and v2+registry of glance. Only Glance setups configured with user_storage_quota are affected.

Steps to reproduce:

1) Login to controller node by ssh.
2) Change token expiration time in 'keystone.conf' from 3600 seconds at 120.
3) Set 'user_storage_quota = 603979780' in 'glance-api.conf'.
4) Run one of the attached scripts (depending on the using api version).
5) When after token expiration time spending, we need to get a list of images of glance and storage backend, and compare them.

Expected result:

Responses from the glance and storage backend service must be identical.

Actual result:

Glance returns an empty list, while storage backend shows that it has some elements.

CVE References

Revision history for this message
Alexey Galkin (agalkin) wrote :
description: updated
description: updated
Revision history for this message
Mike Fedosin (mfedosin) wrote :

Fix for MOS 7.0 on review: https://review.fuel-infra.org/#/c/11914/

Revision history for this message
Mike Fedosin (mfedosin) wrote :
Alexey Galkin (agalkin)
description: updated
Mike Fedosin (mfedosin)
Changed in mos:
status: New → In Progress
Alexey Galkin (agalkin)
summary: - [pre-SSA] Glance user storage quota bypass #2
+ [pre-OSSA] Glance user storage quota bypass #2
Changed in mos:
status: In Progress → Fix Committed
Alexey Galkin (agalkin)
summary: - [pre-OSSA] Glance user storage quota bypass #2
+ Glance user storage quota bypass #2
Revision history for this message
Alexey Galkin (agalkin) wrote : Re: Glance user storage quota bypass #2

Thanks, Mike!
Tested on iso #301 (RC4).
Your fix works correctly, good job!

Changed in mos:
status: Fix Committed → Fix Released
Alexey Galkin (agalkin)
summary: - Glance user storage quota bypass #2
+ [Glance] Glance user storage quota bypass #2
Revision history for this message
Vitaly Sedelnik (vsedelnik) wrote :

Per upstream bug the issue affects juno and kilo, so nominating for 6.0-updates and 6.1-updates

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

I have added liberty into list of nominations.
Also I have corrected the nomination list: added 7.0 into list of nominations. Unfortunately Mirantis Openstack 7.0 is not available anymore in Milestone targets so I leave it empty because the fix has been applied to 7.0 and 7.0 has been released.

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

8.0 already contains the bug fix cause the bug has been merged to upstream before liberty release. So I marked it as won't fix.

information type: Private Security → Public Security
Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change abandoned on openstack/glance (openstack-ci/fuel-6.0-updates/2014.2)

Change abandoned by Alexey Khivin <email address hidden> on branch: openstack-ci/fuel-6.0-updates/2014.2
Review: https://review.fuel-infra.org/12665
Reason: merge #8490 before this

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Change restored on openstack/glance (openstack-ci/fuel-6.0-updates/2014.2)

Change restored by Alexey Khivin <email address hidden> on branch: openstack-ci/fuel-6.0-updates/2014.2
Review: https://review.fuel-infra.org/12665

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/glance (openstack-ci/fuel-6.0-updates/2014.2)

Reviewed: https://review.fuel-infra.org/12665
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-ci/fuel-6.0-updates/2014.2

Commit: f00f61c1431c793342f31d70d61d2dba648a26e4
Author: Mike Fedosin <email address hidden>
Date: Tue Nov 10 16:04:16 2015

Cleanup chunks for deleted image if token expired.

In patch I47229b366c25367ec1bd48aec684e0880f3dfe60 it was
introduced the logic that if image was deleted during file
upload when we want to update image status from 'saving'
to 'active' it's expected to get Duplicate error and delete
stale chunks after that. But if user's token is expired
there will be Unathorized exception and chunks will stay
in store and clog it.
And when, the upload operation for such an image is
completed the operator configured quota can be exceeded.

This patch fixes the issue of left over chunks for an image
which was deleted from saving status, by correcly handle
auth exceptions from registry server

Closes-bug: #1497984

Change-Id: I17a66eca55bfb83107046910e69c4da01415deec
(cherry picked from commit ec89aaa933e4960ea053a6ad57e397574506a362)

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix proposed to openstack/glance (openstack-ci/fuel-5.1.1-updates/2014.1.1)

Fix proposed to branch: openstack-ci/fuel-5.1.1-updates/2014.1.1
Change author: Mike Fedosin <email address hidden>
Review: https://review.fuel-infra.org/13818

Revision history for this message
Fuel Devops McRobotson (fuel-devops-robot) wrote : Fix merged to openstack/glance (openstack-ci/fuel-5.1.1-updates/2014.1.1)

Reviewed: https://review.fuel-infra.org/13818
Submitter: Vitaly Sedelnik <email address hidden>
Branch: openstack-ci/fuel-5.1.1-updates/2014.1.1

Commit: 50c44da2ef20444e51a39f90fc2a801f03d929de
Author: Mike Fedosin <email address hidden>
Date: Wed Nov 11 16:49:03 2015

Cleanup chunks for deleted image if token expired.

In patch I47229b366c25367ec1bd48aec684e0880f3dfe60 it was
introduced the logic that if image was deleted during file
upload when we want to update image status from 'saving'
to 'active' it's expected to get Duplicate error and delete
stale chunks after that. But if user's token is expired
there will be Unathorized exception and chunks will stay
in store and clog it.
And when, the upload operation for such an image is
completed the operator configured quota can be exceeded.

This patch fixes the issue of left over chunks for an image
which was deleted from saving status, by correcly handle
auth exceptions from registry server

Closes-bug: #1497984

Change-Id: I17a66eca55bfb83107046910e69c4da01415deec
(cherry picked from commit ec89aaa933e4960ea053a6ad57e397574506a362)

Revision history for this message
Vadim Rovachev (vrovachev) wrote :

Verified on 5.1.1

Revision history for this message
Vadim Rovachev (vrovachev) wrote :

Verified on 6.0:
packages:
glance-api,glance-common,glance-registry,python-glance
version:
1:2014.2-fuel6.0~mira20

Changed in mos:
status: Fix Committed → Fix Released
tags: added: on-automation
Revision history for this message
TatyanaGladysheva (tgladysheva) wrote :

This scenario is not automatable for MOS 8.0 and above.

tags: removed: on-automation
tags: added: feature-security
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.