[OSSA 2013-027] 'image_download' role in v2 causes traceback
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| | Glance |
Critical
|
Zhi Yan Liu | ||
| | Folsom |
Undecided
|
Unassigned | ||
| | Grizzly |
Critical
|
Stuart McLaren | ||
| | OpenStack Security Advisory |
Medium
|
Thierry Carrez | ||
Bug Description
If you enable the 'image_download' policy as follows:
{
"context_
"download_
"default": "",
"manage_
}
And attempt to download using the v2 api you get 200 rather than 403 (but, correctly, no data)
and a stack trace on the server:
6234 DEBUG glance.api.policy [acaf8321-
6234 DEBUG glance.image_cache [acaf8321-
6234 DEBUG glance.api.policy [acaf8321-
6234 DEBUG glance.
6234 ERROR glance.image_cache [acaf8321-
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache Traceback (most recent call last):
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache for chunk in image_iter:
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache for chunk in self.image.
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache self.policy.
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache exception.
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache return policy.check(rule, target, credentials, *args, **kwargs)
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache File "/opt/stack/
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache raise exc(*args, **kwargs)
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache Forbidden: You are not authorized to complete this action.
2013-10-04 17:34:47.678 6234 TRACE glance.image_cache
6234 DEBUG eventlet.
File "/usr/local/
for data in result:
File "/opt/stack/
for chunk in image_iter:
File "/opt/stack/
for chunk in self.image.
File "/opt/stack/
self.
File "/opt/stack/
exception.
File "/opt/stack/
return policy.check(rule, target, credentials, *args, **kwargs)
File "/opt/stack/
raise exc(*args, **kwargs)
Forbidden: You are not authorized to complete this action.
6234 DEBUG eventlet.
CVE References
| tags: | added: havana-rc-potential |
| Changed in glance: | |
| assignee: | nobody → Zhi Yan Liu (lzy-dev) |
Fix proposed to branch: master
Review: https:/
| Changed in glance: | |
| status: | New → In Progress |
| Changed in glance: | |
| importance: | Undecided → Critical |
| milestone: | none → icehouse-1 |
| Changed in glance: | |
| milestone: | icehouse-1 → havana-rc2 |
| tags: | removed: havana-rc-potential |
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: master
commit a50bfbf490fd354
Author: Zhi Yan Liu <email address hidden>
Date: Mon Oct 7 11:44:33 2013 +0800
Adding 'download_image' policy enforcement to image cache middleware
Currently image cache middleware not care 'download_image' policy, the
enforcement caused user receive empty content but with HTTP 200 code
rather than 403 when client attempt to download image using v2 API. And
the real Forbidden exception be logged in glance-api log which image
application action raised. The end user is confused by this behavior.
Fixes bug: 1235378
Change-Id: Ibaa7ccf8613ee3
Signed-off-by: Zhi Yan Liu <email address hidden>
| Changed in glance: | |
| status: | In Progress → Fix Committed |
This has security implications (as explained in duplicate bug 1235226) and may generate a security advisory.
| information type: | Public → Public Security |
| Changed in ossa: | |
| status: | New → Confirmed |
| importance: | Undecided → Medium |
| Thierry Carrez (ttx) wrote : | #5 |
Grizzly patch proposed: https:/
| tags: | added: grizzly-backport-potential |
Fix proposed to branch: stable/folsom
Review: https:/
Fix proposed to branch: milestone-proposed
Review: https:/
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: milestone-proposed
commit 02e97689e60b643
Author: Zhi Yan Liu <email address hidden>
Date: Mon Oct 7 11:44:33 2013 +0800
Adding 'download_image' policy enforcement to image cache middleware
Currently image cache middleware not care 'download_image' policy, the
enforcement caused user receive empty content but with HTTP 200 code
rather than 403 when client attempt to download image using v2 API. And
the real Forbidden exception be logged in glance-api log which image
application action raised. The end user is confused by this behavior.
Fixes bug: 1235378
Related-Id: Ibaa7ccf8613ee3
Change-Id: I2822ee553d605b
Signed-off-by: Zhi Yan Liu <email address hidden>
(cherry picked from commit a50bfbf490fd354
| Changed in glance: | |
| status: | Fix Committed → Fix Released |
That's Grizzly/Havana only, right ? here is my attempt to an impact description:
===
Title: Glance image_download policy not enforced for cached images
Reporter: Stuart McLaren (HP)
Products: Glance
Affects: Grizzly and later
Description:
Stuart McLaren from HP reported a vulnerability in Glance download_image policy enforcement in the case of cached images. Deployers may opt to set a download_image policy to restrict image download to specific roles. However, when an image is previously cached by an authorized download, any authenticated user could download image contents if it can guess the image UUID, bypassing any download_image policy restrictions. This could result in disclosure of image contents that were thought to be protected by the download_image policy setting. Only setups making use of the download_image policy are affected.
| Changed in ossa: | |
| assignee: | nobody → Thierry Carrez (ttx) |
| status: | Confirmed → Triaged |
| Zhi Yan Liu (lzy-dev) wrote : | #10 |
@ttx, No I consider folsom need to fix also: https:/
| Stuart McLaren (stuart-mclaren) wrote : | #11 |
Zhi Yan,
Thanks!
Thierry:
Thanks for drawing up a wording.
"if it can guess the image UUID": in the case of public images there's not really any guessing required ... a public image's UUID will be visible when they list images. (Public images will also be more likely to be cached.)
| Thierry Carrez (ttx) wrote : | #12 |
that said, public images also are unlikely to be protected by image_download... but yeah. how about:
===
Title: Glance image_download policy not enforced for cached images
Reporter: Stuart McLaren (HP)
Products: Glance
Affects: All versions
Description:
Stuart McLaren from HP reported a vulnerability in Glance download_image policy enforcement in the case of cached images. Deployers may opt to set a download_image policy to restrict image download to specific roles. However, when an image is previously cached by an authorized download, any authenticated user could download image contents if it can determine the image UUID, bypassing any download_image policy restrictions. This could result in disclosure of image contents that were thought to be protected by the download_image policy setting. Only setups making use of the download_image policy are affected.
| Stuart McLaren (stuart-mclaren) wrote : | #13 |
Thanks Thierry -- looks good to me!
(FWIW download_image may be useful for public images which are licensed.)
Reviewed: https:/
Committed: http://
Submitter: Jenkins
Branch: stable/folsom
commit feb735412021b77
Author: Zhi Yan Liu <email address hidden>
Date: Mon Oct 7 11:44:33 2013 +0800
Adding 'download_image' policy enforcement to image cache middleware
Currently image cache middleware not care 'download_image' policy, the
enforcement caused user receive empty content but with HTTP 200 code
rather than 403 when client attempt to download image using v2 API. And
the real Forbidden exception be logged in glance-api log which image
application action raised. The end user is confused by this behavior.
Fixes bug: 1235378
Related-Id: Ibaa7ccf8613ee3
Change-Id: I6ce09c764436da
Signed-off-by: Zhi Yan Liu <email address hidden>
(cherry picked from commit a50bfbf490fd354
The proposed impact description in comment #12 looks accurate to me.
| Thomas Goirand (thomas-goirand) wrote : | #17 |
Hi,
Would Essex also be vulnerable?
Thomas
| Changed in glance: | |
| milestone: | havana-rc2 → 2013.2 |
| Thierry Carrez (ttx) wrote : | #18 |
CVE-2013-4428
| Jamie Strandboge (jdstrand) wrote : | #19 |
The patch for Folsom adds tests for the v1 API, so I assume Essex is also affected and the Folsom patches backported.
| Thierry Carrez (ttx) wrote : | #20 |
OSSA to be released tomorrow Tuesday, Oct 22
| Changed in ossa: | |
| status: | In Progress → Fix Committed |
| Thierry Carrez (ttx) wrote : | #21 |
[OSSA 2013-027]
| Changed in ossa: | |
| status: | Fix Committed → Fix Released |
| summary: |
- 'image_download' role in v2 causes traceback + [OSSA 2013-027] 'image_download' role in v2 causes traceback |
| Jamie Strandboge (jdstrand) wrote : | #22 |
Looks like essex is not affected after all. 'download_image' functionality was not added until folsom (see bug #1038086).
| tags: | removed: grizzly-backport-potential |


I'm unlikely to be able to look at this in the short term, so if anyone else would like to pick it up feel free!