using glance v2 api does not remove temporary files

Bug #1674846 reported by Erik Olof Gunnar Andersson
258
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Expired
Undecided
Unassigned
OpenStack Security Advisory
Won't Fix
Undecided
Unassigned

Bug Description

Currently if you are using Glance v2 with TemporaryUploadedFile (legacy mode?) the temporary file created on disk is never removed. This will eventually cause the machine to run out of tmp disk space.

The issue is that if Glance v2 is used, the code never calls image_update which is responsible for deleting the temporary file.
https://github.com/openstack/horizon/blob/446e5aefb4354c9092d1cbc5ff258ee74558e769/openstack_dashboard/api/glance.py#L439
https://github.com/openstack/horizon/blob/446e5aefb4354c9092d1cbc5ff258ee74558e769/openstack_dashboard/api/glance.py#L349

Either the function image_update should always be called, or if data is a TemporaryUploadedFile object, the call should always try to delete the temporary file once done.

Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

Since this report concerns a possible security risk, an incomplete security advisory task has been added while the core security reviewers for the affected project or projects confirm the bug and discuss the scope of any vulnerability along with potential solutions.

Changed in ossa:
status: New → Incomplete
description: updated
Revision history for this message
Tristan Cacqueray (tristan-cacqueray) wrote :

@horizon-coresec, can you check this report please?
Is the TemporaryUploadedFile the default behavior for Horizon deployment?

Revision history for this message
Jeremy Stanley (fungi) wrote :

In keeping with recent OpenStack vulnerability management policy changes, no report should remain under private embargo for more than 90 days. Because this report predates the change in policy, the deadline for public disclosure is being set to 90 days from today. If the report is not resolved within the next 90 days, it will revert to our public workflow as of 2020-05-27. Please see http://lists.openstack.org/pipermail/openstack-discuss/2020-February/012721.html for further details.

description: updated
Revision history for this message
Jeremy Stanley (fungi) wrote :

It doesn't look like this report has seen any activity since my update two months ago, so consider this a friendly reminder:

The embargo for this report is due to expire one month from today, on May 27, and will be switched public on or shortly after that day if it is not already resolved sooner.

Thanks!

Jeremy Stanley (fungi)
description: updated
Revision history for this message
Jeremy Stanley (fungi) wrote :

The embargo for this report has expired and is now lifted, so it's acceptable to discuss further in public.

description: updated
information type: Private Security → Public Security
Revision history for this message
Vishal Manchanda (vishalmanchanda) wrote :

hi, I tried to reproduce this bug on the master branch but not succeed.
I think it is already fixed by [1].
So when you try to create an image using django(leagcy) way, it will create a
temporary file which will be deleted once the upload is completed[2].

[1] https://review.opendev.org/c/openstack/horizon/+/703632
[2] https://github.com/openstack/horizon/blob/master/openstack_dashboard/api/glance.py#L517

If you still face the same issue, please add more steps to reproduce it.

Changed in horizon:
status: New → Incomplete
no longer affects: horizon
Changed in horizon:
status: New → Incomplete
Revision history for this message
Jeremy Stanley (fungi) wrote :

The indicated fix merged during the Ussuri development cycle, so in theory this bug should be valid only for stable/train and older branches. Given stable/train is scheduled to enter extended maintenance phase tomorrow, there is no opportunity to backport the fix to it and issue a point release at this stage. The fix could still be backported under extended maintenance if someone is interested in working on that, but there would be no point in issuing a security advisory for it because it will never appear in a point release for that series. As such, I'm marking our security advisory task won't fix to reflect this.

Changed in ossa:
status: Incomplete → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for OpenStack Dashboard (Horizon) because there has been no activity for 60 days.]

Changed in horizon:
status: Incomplete → Expired
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.