REDHAT-BUG-2524517: SSRF
OpenStack Glance is the image service for OpenStack. A Server-Side Request Forgery (SSRF) vulnerability exists in the image location APIs (POST /v2/images/{id}/locations and PATCH /v2/images/{id} with location JSON-patch). When the HTTP store backend is enabled, an authenticated project member can add an image location URL pointing to internal network services (for example http://169.254.169.254/). Glance-api validates only the URL scheme via validateexternallocation() in glance/common/storeutils.py (blocking file://, filesystem://, swift+config://) but performs no host, IP, or port filtering.
In contrast, the web-download import path (fixed by OSSA-2026-004 / CVE-2026-34881) correctly calls validateimporturi() in glance/common/utils.py, which checks allowed/disallowed hosts and ports via importfilteringopts. The location API code paths bypass this filtering entirely. When a location is added, glancestore makes HTTP HEAD (size check) and GET (hash calculation) requests to the attacker-supplied URL. The response body becomes the image data and can be read via GET /v2/images/{id}/file.
The new POST /locations API requires only the addimagelocation policy (SERVICEORPROJECTMEMBER) and does not require showmultiplelocations. The old PATCH API requires showmultiplelocations=True and the setimagelocation policy. Fix is not yet available (coordinating with upstream).
Reporter: Cyril Roelandt (OpenStack Glance PTL, Glance Core Security Team) Upstream: https://bugs.launchpad.net/glance/+bug/2161330 PSIRT Ticket: PSIRTSUPT-22366 Downstream tracker: OSPRH-34480