Where
-Infinity
0
Severity
6.9
AV:A/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:N

A flaw was found in ironic-image. The scripts responsible for constructing kernel parameters for CoreOS root file system (rootfs) and Ignition configuration URLs use a hardcoded http:// scheme. This bypasses the intended Transport Layer Security (TLS) protection, even when TLS is enabled for the iPXE boot chain. An attacker on the local network segment can exploit this vulnerability by performing Address Resolution Protocol (ARP) spoofing to serve a malicious rootfs or intercept sensitive data, including SSH keys and secrets, from the Ignition configuration. This leads to a compromise of data integrity and confidentiality during the node provisioning process.

First published (updated )

===================================================================== OSSA-2026-053: Networking-Generic-Switch does not sanitize all inputs =====================================================================

:Date: November 19, 2026 :CVE: CVE-2026-131919

Affects ~~~~~~~ Description ~~~~~~~~~~~ Patches ~~~~~~~ - https://review.opendev.org/1016499 (2023.1/antelope (unmaintained)) - https://review.opendev.org/1016498 (2024.1/caracal (unmaintained)) - https://review.opendev.org/1016496 (2025.1/epoxy (unmaintained)) - https://review.opendev.org/1016495 (2025.2/flamingo (stable)) - https://review.opendev.org/1016494 (2026.1/gazpacho (stable)) - https://review.opendev.org/1016493 (2026.2/hibiscus (stable)) - https://review.opendev.org/1016492 (2027.1/indri (development))

Credits ~~~~~~~ - Jay Faulkner from G-Research OSS

References ~~~~~~~~~~ - https://launchpad.net/bugs/2163364 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-131919

Notes ~~~~~ - Unmaintained branches (2025.1, 2024.1, 2023.1) are not actively   maintained and no longer receive new releases, but a patch is being   provided as a convenience.

==================================================================== OSSA-2026-051: Local Privilege Escalation in Cinder LIO iSCSI driver ====================================================================

:Date: November 17, 2026 :CVE: CVE-2026-131920

Affects ~~~~~~~ - Cinder: <27.1.1, >=28.0.0 <28.1.1, >=29.0.0 <29.1.1

Description ~~~~~~~~~~~ Sami Yessou, cloud engineer at switch.ch, reported a vulnerability in Cinder. By making an os-initializeconnection request with an IQN that includes a path traversal as part of the connector's initiator element, an authenticated user with a 'member' role may create or overwrite files in the volume host filesystem. Only cinder-volume hosts using the LIO iSCSI target driver are affected. This target driver is typically used with the LVM volume driver.

Errata ~~~~~~ MITRE assigned CVE-2026-131920 after initial publication.

Patches ~~~~~~~ - https://review.opendev.org/1015676 (2025.1/epoxy (unmaintained)) - https://review.opendev.org/1015654 (2025.2/flamingo) - https://review.opendev.org/1015486 (2026.1/gazpacho) - https://review.opendev.org/1015485 (2026.2/hibiscus) - https://review.opendev.org/1015478 (2027.1/indri (development))

Credits ~~~~~~~ - Sami Yessou from switch.ch (CVE-2026-131920)

References ~~~~~~~~~~ - https://launchpad.net/bugs/2163562 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-131920

Notes ~~~~~ - A patch is available for the unmaintained/2025.1 branch as a courtesy. Unmaintained branches do not receive updated releases.

OSSA History ~~~~~~~~~~~~ - 2026-11-18 - Errata 1 - 2026-11-17 - Original Version

Severity
6.9
Path Traversal
AV:N/AC:L/AT:N/PR:L/UI:A/VC:N/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:Y/R:I/V:D/RE:M/U:Green

(In OpenStack Cinder before 29.1.1, by making an os-initializeconnecti ...)

1 / 2
Source: OSV
First published (updated )
Severity
9.6
OS Command Injection, Command Injection
AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H

A command injection vulnerability was found in OpenStack Cinder's SSH-based storage-driver support. Incomplete validation of shell metacharacters allows an authenticated user who owns a volume on an affected backend to supply crafted connection information and inject additional commands into the storage array's management interface. Commands execute with the privileges of Cinder's configured backend account. This can disclose storage configuration information and, where that account has administrative permissions, could allow changes that affect the integrity or availability of other tenants' storage.

1 / 2
Source: MITRE
First published (updated )
Severity
4.3
AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L

OpenStack Ironic through 39.0.1 allows a denial of service via a configdrive that results in a very large amount of uncompressed data, aka a gzip bomb.

1 / 2
Source: Ubuntu
First published (updated )
Severity
5
AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:L

OpenStack Ironic before 39.0.1 sometimes allows a user to change the maintenance setting on a node via PATCH to /v1/nodes/{ident} - in other words, not using the specific maintenance endpoint.

First published (updated )
Severity
5.4
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N

OpenStack Ironic before 39.0.1 allows DELETE and GET via vendorpassthru, e.g., to delete accounts from the BMC's Redfish service.

First published (updated )

======================================================================== OSSA-2026-048: Ironic allows generic node update for maintenance setting ========================================================================

:Date: October 22, 2026 :CVE: CVE-2026-89419

Affects ~~~~~~~ Description ~~~~~~~~~~~ The Metal3.io Security team reported a vulnerability in Ironic's API. When calling the Node maintenance API at /v1/nodes/{ident}/maintenance, Ironic properly applies the baremetal:node:setmaintenance and baremetal:node:clearmaintenance policies.

However, if a user instead calls the more generic Node update API by sending an HTTP PATCH to /v1/nodes/{ident}, and includes maintenance or maintenancereason in the dictionary, they can instead trigger the baremetal:node:update policy. This may lead to users unexpectedly having access to change the maintenance setting on a node.

For clouds using default Ironic policy, this means someone with the member role on the project indicated in node.lessee can change maintenance on the node. This is typically restricted only to accounts with manager or admin roles on lessee accounts. There is no change in effective default permissions in the case of node.owner project members or system-scoped users.

Patches ~~~~~~~ - https://review.opendev.org/1011871 (2024.1/caracal (unmaintained)) - https://review.opendev.org/1011869 (2025.1/epoxy) - https://review.opendev.org/1011867 (2025.2/flamingo) - https://review.opendev.org/1011865 (2026.1/gazpacho) - https://review.opendev.org/1011863 (2026.2/hibiscus) - https://review.opendev.org/1011861 (2027.1/indri (development)) - https://review.opendev.org/1011875 (Bugfix/37.0) - https://review.opendev.org/1011873 (Bugfix/38.0)

Credits ~~~~~~~ - Dmitry Tantsur, Metal3.io Security Team from Red Hat (CVE-2026-89419)

References ~~~~~~~~~~ - https://launchpad.net/bugs/2166510 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-89419

Notes ~~~~~ - Patches for unmaintained/2024.1, bugfix/38.0, and bugfix/37.0 will be   merged to git but no new release will be provided.

========================================================================== OSSA-2026-047: Redfish vendorpassthru method allows path injection via ID ==========================================================================

:Date: October 22, 2026 :CVE: CVE-2026-90458

Affects ~~~~~~~ Description ~~~~~~~~~~~ The Metal3.io Security team reported a vulnerability in Ironic's API. When calling the vendorpassthru API endpoint provided by the redfish management interface to create or delete a subscription, a malicious System-scoped Administrator could instead perform an HTTP DELETE or HTTP GET on an arbitrary path on a node's BMC. In a worst case scenario, this could lead to user accounts being deleted from the Redfish service on the BMC.

Only clouds with nodes enrolled in a redfish hardware type are susceptible to this vulnerability.

Patches ~~~~~~~ - https://review.opendev.org/1011870 (2024.1/caracal (unmaintained)) - https://review.opendev.org/1011868 (2025.1/epoxy) - https://review.opendev.org/1011866 (2025.2/flamingo) - https://review.opendev.org/1011864 (2026.1/gazpacho) - https://review.opendev.org/1011862 (2026.2/hibiscus) - https://review.opendev.org/1011860 (2027.1/indri (development)) - https://review.opendev.org/1011874 (Bugfix/37.0) - https://review.opendev.org/1011872 (Bugfix/38.0)

Credits ~~~~~~~ - Dmitry Tantsur, Metal3.io Security Team from Red Hat (CVE-2026-90458)

References ~~~~~~~~~~ - https://launchpad.net/bugs/2166507 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-90458

Notes ~~~~~ - Patches for unmaintained/2024.1, bugfix/38.0 and bugfix/37.0 will be   merged to git but no new release will be provided.

Severity
4.3
AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N

In OpenStack Cinder through 29.0.0, cross-project information disclosure can occur in the Messages API. A non-admin user with the project-scoped 'member' or 'reader' role making the Block Storage API v3.3 "List messages" call finds the non-expired user messages for other projects included in the response, resulting in the leakage of UUIDs of resources owned by other projects, in addition to the user message about the other projects' resources (which, by design, are sanitized generic messages). All Cinder deployments are affected.

First published (updated )

============================================================= ============================================================= Summary ~~~~~~~ Dmitry Tantsur (Red Hat) and Tuomo Tanskanen (Ericsson Software Technology) from the Metal3.io security team reported a vulnerability in Ironic. When a deployment can set instanceinfo/imagesource or Affected Services / Software ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Discussion ~~~~~~~~~~ The fix adds a [deploy]/imageserverauthhosts option allowing operators to restrict the hosts to which credentials are sent, along with a [deploy]/imageserverauthpermitunknownhosts option.

Deployments of OpenStack-integrated Ironic typically use Glance for image management and are not impacted by this vulnerability.

Recommended Actions ~~~~~~~~~~~~~~~~~~~ Operators utilizing the basic auth feature for image retrieval should:

Apply the relevant patch for their release set [deploy]/imageserverauthhosts to a list of acceptable   hosts to pass authentication credentials to set [deploy]/imageserverauthpermitunknownhosts to False

Ironic intends to change the default of [deploy]/imageserverauthpermitunknownhosts to False in the 2027.1 release. See https://review.opendev.org/999907 for more information.

Patches 2026.2/hibiscus: https://review.opendev.org/999744 2026.1/gazpacho: https://review.opendev.org/1003587 2025.2/flamingo: https://review.opendev.org/1003597 2025.1/epoxy: https://review.opendev.org/1003598 bugfix/38.0: https://review.opendev.org/1003577 bugfix/37.0: https://review.opendev.org/1003579

Credits:

Tuomo Tanskanen, Metal3.io Security Team (Ericsson Software Technology) Dmitry Tantsur, Metal3.io Security Team (Red Hat)

Contacts / References ~~~~~~~~~~~~~~~~~~~~~ Author: Jay Faulkner (G-Research OSS)

Original bug : https://launchpad.net/bugs/2162816 This OSSN : https://docs.openstack.org/security-notes/OSSN-0110.html Mailing List : openstack-discuss () lists openstack org OpenStack Security : https://security.openstack.org/ CVE-2026-90461 : https://nvd.nist.gov/vuln/detail/CVE-2026-90461

Severity
7.2
AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:H/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In OpenStack Mistral through 23.0.0, several of the v2 API write paths resolve the target object with a query that can return another project's resource, then write to it. An authenticated project member can use this to rewrite and un-publish another project's public action definitions and environments. A project administrator can create a workbook whose embedded ad-hoc action or workflow name collides with a resource of another project, which moves that resource into the caller's project and causes the original owner's subsequent updates of it to fail with server errors. Only deployments exposing the Mistral API are affected.

First published (updated )
Severity
6
AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In OpenStack Mistral through 23.0.0, the workflow membership API lets a project that has accepted a share of another project's private workflow create a further membership naming a third project. The new membership row is created with its projectid defaulted to the accepting project rather than the original workflow owner, and thus the owner can neither see nor delete it. The third project can accept this membership (that it had not actually been granted by the owner), and then read and execute the owner's private workflow; only the accepting (not the owning) project can later revoke that access.

First published (updated )
Severity
7.1
AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In OpenStack Mistral through 23.0.0, the /v2/maintenance API controller clears the request context and calls the maintenance service directly without any policy enforcement. Any holder of a valid Mistral token, regardless of assigned role, can read and change the service's cluster-wide maintenance state. Setting the state to PAUSED stops processing of new workflow and execution objects across all tenant projects until an operator restores it.

First published (updated )
Severity
8.7
OS Command Injection
AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:L/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In OpenStack Mistral through 23.0.0, the std.sshproxied action passes a caller-supplied proxycommand value directly to paramiko.ProxyCommand() before any SSH connection to a gateway or target host is attempted. An authenticated project member can use the standard action-execution API to submit an arbitrary local command as proxycommand; paramiko starts that command as a subprocess on the executor host under the executor's own service account, independent of whether the SSH connection itself ever succeeds. Only Mistral deployments that permit the std.sshproxied action, the default configuration, are affected.

First published (updated )

========================================================================== OSSA-2026-044: Four authorization and privilege vulnerabilities in Mistral ==========================================================================

:Date: October 08, 2026 :CVE: CVE-2026-93858, CVE-2026-93860, CVE-2026-93861, CVE-2026-97147

Affects ~~~~~~~ - Mistral: <20.1.1, ==21.0.0, ==22.0.0, ==23.0.0

Description ~~~~~~~~~~~

Patches ~~~~~~~ - https://review.opendev.org/1009502 (2025.1/epoxy) - https://review.opendev.org/1009503 (2025.1/epoxy) - https://review.opendev.org/1009504 (2025.1/epoxy) - https://review.opendev.org/1009505 (2025.1/epoxy) - https://review.opendev.org/1009506 (2025.1/epoxy) - https://review.opendev.org/1009507 (2025.1/epoxy) - https://review.opendev.org/1009508 (2025.1/epoxy) - https://review.opendev.org/1009509 (2025.1/epoxy) - https://review.opendev.org/1009493 (2025.2/flamingo) - https://review.opendev.org/1009494 (2025.2/flamingo) - https://review.opendev.org/1009495 (2025.2/flamingo) - https://review.opendev.org/1009496 (2025.2/flamingo) - https://review.opendev.org/1009497 (2025.2/flamingo) - https://review.opendev.org/1009498 (2025.2/flamingo) - https://review.opendev.org/1009499 (2025.2/flamingo) - https://review.opendev.org/1009500 (2025.2/flamingo) - https://review.opendev.org/1009484 (2026.1/gazpacho) - https://review.opendev.org/1009485 (2026.1/gazpacho) - https://review.opendev.org/1009486 (2026.1/gazpacho) - https://review.opendev.org/1009487 (2026.1/gazpacho) - https://review.opendev.org/1009488 (2026.1/gazpacho) - https://review.opendev.org/1009489 (2026.1/gazpacho) - https://review.opendev.org/1009490 (2026.1/gazpacho) - https://review.opendev.org/1009491 (2026.1/gazpacho) - https://review.opendev.org/1009476 (2026.2/hibiscus) - https://review.opendev.org/1009477 (2026.2/hibiscus) - https://review.opendev.org/1009478 (2026.2/hibiscus) - https://review.opendev.org/1009479 (2026.2/hibiscus) - https://review.opendev.org/1009480 (2026.2/hibiscus) - https://review.opendev.org/1009481 (2026.2/hibiscus) - https://review.opendev.org/1009482 (2026.2/hibiscus) - https://review.opendev.org/1009483 (2026.2/hibiscus) - https://review.opendev.org/1009468 (2027.1/indri (development)) - https://review.opendev.org/1009469 (2027.1/indri (development)) - https://review.opendev.org/1009470 (2027.1/indri (development)) - https://review.opendev.org/1009471 (2027.1/indri (development)) - https://review.opendev.org/1009472 (2027.1/indri (development)) - https://review.opendev.org/1009473 (2027.1/indri (development)) - https://review.opendev.org/1009474 (2027.1/indri (development)) - https://review.opendev.org/1009475 (2027.1/indri (development))

Credits ~~~~~~~ - Arnaud Morin from OVHcloud (CVE-2026-97147) References ~~~~~~~~~~ - https://launchpad.net/bugs/2160267 (CVE-2026-97147) - https://launchpad.net/bugs/2161277 (CVE-2026-93861) - https://launchpad.net/bugs/2162100 (CVE-2026-93858) - https://launchpad.net/bugs/2162789 (CVE-2026-93860) - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-93858 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-93860 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-93861 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97147

-- Jeremy Stanley OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

Severity
9.9
AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H

Description: Chen YuXiang from the Institute of Computing Technology, Chinese Academy of Sciences reported a vulnerability in Manila's public share authorization handling. The "ispublic" flag grants a share API visibility to all projects without transferring management authority, and the controller authorizes write operations against the caller's own project rather than the target share's project. By performing management operations on a public share owned by another project, a project member may add, update, or revoke access rules, modify export-location metadata, create backups or replicas, and soft-delete or restore the share, resulting in unauthorized cross-project data access and the potential to deny the owner access to their own share. Only deployments in which at least one share is marked public are affected.

Proposed patch: See attached patches. Unless a flaw is discovered in them, these patches will be merged to their corresponding branches on the public disclosure date. One patch targets manila-tempest-plugin: it updates two negative tests to expect 404 instead of 403 for unauthorized access to another project's share, matching the corrected authorization behavior; it will follow the core fixes once they merge.

CVE: CVE-2026-71195

Proposed public disclosure date/time: 2026-10-20, 1500UTC Please do not make the issue public (or release public patches) before this coordinated embargo date.

Original private report: https://launchpad.net/bugs/2161412 For access to read and comment on this report, please reply to me with your Launchpad username and I will subscribe you.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

Patch From 9c862f231be81c9b0dfa2645cbcd0dab7e0d6a40 Mon Sep 17 00:00:00 2001 From: Carlos da Silva <ces.eduardo98> Date: Fri, 7 Aug 2026 20:55:09 -0300 Subject: [PATCH] Fix policy control for public shares

A public share is visible to all tenants, but users other than the owner should not be able to modify it. Several operations skipped the ownership policy check for public shares. Also, the export location metadata endpoints resolved the export location globally, instead of within the share in the request URL.

This commit enforces the ownership checks when manipulating access rules, creating backups or replicas, and soft deleting or restoring public shares. Export location metadata operations are now scoped to the share in the request URL; export locations that do not belong to that share now return 404.

Change-Id: Ie283dce157f9c90f5d2ab38c1e74daa7df3ac118 Signed-off-by: Carlos da Silva <ces.eduardo98> Closes-Bug: #2161412 Closes-Bug: #2168962

#+beginsrc diff --- manila/api/v2/metadata.py | 5 +- manila/api/v2/shareaccesses.py | 3 +- manila/api/v2/sharebackups.py | 3 +- manila/api/v2/shareexportlocations.py | 35 ++++--- manila/api/v2/sharereplicas.py | 3 +- manila/api/v2/shares.py | 8 +- manila/share/api.py | 8 +- manila/tests/api/v2/testmetadata.py | 41 ++++++++ manila/tests/api/v2/testshareaccesses.py | 55 +++++++++-- manila/tests/api/v2/testsharebackups.py | 25 ++++- .../api/v2/testshareexportlocations.py | 35 ++++++- manila/tests/api/v2/testsharereplicas.py | 47 ++++++++- manila/tests/api/v2/testshares.py | 96 +++++++++++++++++-- manila/tests/share/testapi.py | 58 +++++++++++ ...cks-on-public-shares-6cb60f669bb20f6c.yaml | 11 +++ 15 files changed, 380 insertions(+), 53 deletions(-) create mode 100644 releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml

diff --git a/manila/api/v2/metadata.py b/manila/api/v2/metadata.py index 174be16..ad07ec4 100644 --- a/manila/api/v2/metadata.py +++ b/manila/api/v2/metadata.py @@ -99,7 +99,10 @@ class MetadataController(object): getresmethod = getattr( db, self.resourceget[self.resourcename]) if parentid is not None: - kwargs["parentid"] = parentid + if self.resourcename == 'shareexportlocation': + kwargs["shareid"] = parentid + else: + kwargs["parentid"] = parentid if self.resourcename == 'sharereplica': kwargs['withsharedata'] = True res = getresmethod(context, resourceid, kwargs) diff --git a/manila/api/v2/shareaccesses.py b/manila/api/v2/shareaccesses.py index 78148a5..ece6e63 100644 --- a/manila/api/v2/shareaccesses.py +++ b/manila/api/v2/shareaccesses.py @@ -168,7 +168,8 @@ class ShareAccessesController(wsgi.Controller, wsgi.AdminActionsMixin): if accesslevel == shareaccess.accesslevel: return self.viewbuilder.view(req, shareaccess) - share = self.shareapi.get(context, shareaccess.shareid) + share = self.shareapi.get( + context, shareaccess.shareid, formodification=True) values = { 'accesslevel': accesslevel, } diff --git a/manila/api/v2/sharebackups.py b/manila/api/v2/sharebackups.py index afae556..4f82c06 100644 --- a/manila/api/v2/sharebackups.py +++ b/manila/api/v2/sharebackups.py @@ -158,7 +158,8 @@ class ShareBackupController(wsgi.Controller, wsgi.AdminActionsMixin): raise exc.HTTPBadRequest(explanation=msg) try: - share = self.shareapi.get(context, shareid) + share = self.shareapi.get( + context, shareid, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPBadRequest(explanation=msg % shareid) diff --git a/manila/api/v2/shareexportlocations.py b/manila/api/v2/shareexportlocations.py index 3106d3d..48157e7 100644 --- a/manila/api/v2/shareexportlocations.py +++ b/manila/api/v2/shareexportlocations.py @@ -26,6 +26,7 @@ from manila.db import api as dbapi from manila import exception from manila.i18n import from manila import policy +from manila.share import api as shareapi LOG = log.getLogger(name) CONF = cfg.CONF @@ -43,12 +44,13 @@ class ShareExportLocationController(wsgi.Controller, self.confadminonlymetadatakeys = getattr( CONF, 'adminonlyelmetadata', [] ) + self.shareapi = shareapi.API() - def verifyshare(self, context, shareid): + def verifyshare(self, context, shareid, formodification=False): try: - share = dbapi.shareget(context, shareid) - if not share['ispublic']: - policy.checkpolicy(context, 'share', 'get', share) + self.shareapi.get( + context, shareid, formodification=formodification + ) except exception.NotFound: msg = ("Share '%s' not found.") % shareid raise exc.HTTPNotFound(explanation=msg) @@ -165,7 +167,7 @@ class ShareExportLocationController(wsgi.Controller, """Returns the list of metadata for a given share export location.""" context = req.environ['manila.context'] self.verifyshare(context, shareid) - return self.indexmetadata(req, resourceid) + return self.indexmetadata(req, resourceid, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -178,8 +180,9 @@ class ShareExportLocationController(wsgi.Controller, delete=False) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.createmetadata(req, resourceid, body) + self.verifyshare(context, shareid, formodification=True) + return self.createmetadata( + req, resourceid, body, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -191,8 +194,9 @@ class ShareExportLocationController(wsgi.Controller, body['metadata']) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.updateallmetadata(req, resourceid, body) + self.verifyshare(context, shareid, formodification=True) + return self.updateallmetadata( + req, resourceid, body, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -205,8 +209,9 @@ class ShareExportLocationController(wsgi.Controller, delete=False) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.updatemetadataitem(req, resourceid, body, key) + self.verifyshare(context, shareid, formodification=True) + return self.updatemetadataitem( + req, resourceid, body, key, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("getmetadata") @@ -216,7 +221,8 @@ class ShareExportLocationController(wsgi.Controller, """Show metadata for a given share export location.""" context = req.environ['manila.context'] self.verifyshare(context, shareid) - return self.showmetadata(req, resourceid, key) + return self.showmetadata( + req, resourceid, key, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("deletemetadata") @@ -224,8 +230,9 @@ class ShareExportLocationController(wsgi.Controller, def deletemetadata(self, req, shareid, resourceid, key): """Delete metadata for a given share export location.""" context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.deletemetadata(req, resourceid, key) + self.verifyshare(context, shareid, formodification=True) + return self.deletemetadata( + req, resourceid, key, parentid=shareid) def createresource(): diff --git a/manila/api/v2/sharereplicas.py b/manila/api/v2/sharereplicas.py index c7cce66..d29983d 100644 --- a/manila/api/v2/sharereplicas.py +++ b/manila/api/v2/sharereplicas.py @@ -206,7 +206,8 @@ class ShareReplicationController(wsgi.Controller, metadata.MetadataController, raise exc.HTTPBadRequest(explanation=msg) try: - shareref = db.shareget(context, shareid) + shareref = self.shareapi.get( + context, shareid, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPNotFound(explanation=msg % shareid) diff --git a/manila/api/v2/shares.py b/manila/api/v2/shares.py index c3c0708..0baac35 100644 --- a/manila/api/v2/shares.py +++ b/manila/api/v2/shares.py @@ -432,7 +432,7 @@ class ShareController( LOG.debug("Soft delete share with id: %s", id, context=context) try: - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) self.shareapi.softdelete(context, share) except exception.NotFound: raise exc.HTTPNotFound() @@ -457,7 +457,7 @@ class ShareController( LOG.debug("Restore share with id: %s", id, context=context) try: - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPNotFound(explanation=msg % id) @@ -792,7 +792,7 @@ class ShareController( accessdata = body.get('allowaccess', body.get('os-allowaccess')) if not enablemetadata: accessdata.pop('metadata', None) - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) if share.get('issoftdeleted'): msg = ("Cannot allow access for share '%s' " @@ -937,7 +937,7 @@ class ShareController( self.checkforaccessrulelocks(context, accessdata, accessid, id) - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) if share.get('issoftdeleted'): msg = ("Cannot deny access for share '%s' " diff --git a/manila/share/api.py b/manila/share/api.py index 96b657a..f3ee109 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -2427,11 +2427,13 @@ class API(base.Base): def snapshotupdate(self, context, snapshot, fields): return self.db.sharesnapshotupdate(context, snapshot['id'], fields) - def get(self, context, shareid): + def get(self, context, shareid, formodification=False): share = self.db.shareget(context, shareid) - if not share['ispublic']: + shareispublic = share['ispublic'] + if not shareispublic or formodification: authorized = policy.checkpolicy( - context, 'share', 'get', share, doraise=False) + context, 'share', 'get', share, + doraise=shareispublic and formodification) if not authorized: raise exception.NotFound() if share['status'] in ( diff --git a/manila/tests/api/v2/testmetadata.py b/manila/tests/api/v2/testmetadata.py index d443f0c..b031afa 100644 --- a/manila/tests/api/v2/testmetadata.py +++ b/manila/tests/api/v2/testmetadata.py @@ -17,6 +17,7 @@ import webob from manila.api.v2 import metadata from manila import context +from manila import db from manila import exception from manila import policy from manila import test @@ -81,6 +82,46 @@ class MetadataAPITest(test.TestCase): policyresourceobj = mockpolicycheck.callargs[0][3] self.assertEqual(shareobj['id'], policyresourceobj['id']) + def testgetresourceexportlocationscopedtoshare(self): + # Export location lookups must be scoped to the share in the + # request URL, so that the metadata of an export location + # belonging to a different share cannot be retrieved. + self.controller.resourcename = 'shareexportlocation' + fakecontext = context.RequestContext('fake', 'fake') + exportlocation = {'id': 'fake-el-uuid'} + mockgetbyuuid = self.mockobject( + db, 'exportlocationgetbyuuid', + mock.Mock(returnvalue=exportlocation)) + + res = self.controller.getresource( + fakecontext, 'fake-el-uuid', formodification=True, + parentid='fake-share-id') + + self.assertEqual(exportlocation, res) + mockgetbyuuid.assertcalledoncewith( + fakecontext, 'fake-el-uuid', shareid='fake-share-id') + self.mockpolicycheck.assertnotcalled() + + def testgetresourceexportlocationnotinsharenotfound(self): + # An export location that does not belong to the share in the + # request URL must not be accessible, regardless of the type + # of the share it belongs to. + self.controller.resourcename = 'shareexportlocation' + fakecontext = context.RequestContext('fake', 'fake') + self.mockobject( + db, 'exportlocationgetbyuuid', + mock.Mock(sideeffect=exception.ExportLocationNotFound( + uuid='fake-el-uuid'))) + + self.assertRaises( + webob.exc.HTTPNotFound, + self.controller.getresource, + fakecontext, + 'fake-el-uuid', + formodification=True, + parentid='fake-share-id', + ) + def testcreateindexmetadata(self): url = self.getrequest() body = {'metadata': {'testkey1': 'testv1', 'testkey2': 'testv2'}} diff --git a/manila/tests/api/v2/testshareaccesses.py b/manila/tests/api/v2/testshareaccesses.py index bb84d23..0b8319f 100644 --- a/manila/tests/api/v2/testshareaccesses.py +++ b/manila/tests/api/v2/testshareaccesses.py @@ -15,7 +15,6 @@ from unittest import mock -import copy import ddt from webob import exc @@ -247,17 +246,55 @@ class ShareAccessesAPITest(test.TestCase): return req def testupdateaccesslevel(self): - updateshareaccess = copy.deepcopy(self.access) - updateshareaccess.update({'accesslevel': 'ro'}) - self.mockobject( + fakeaccess = mock.Mock( + accesslevel='rw', shareid=self.share['id']) + updatedaccess = mock.Mock( + accesslevel='ro', shareid=self.share['id']) + mockgetaccess = self.mockobject( + self.controller, 'getshareaccess', + mock.Mock(returnvalue=fakeaccess)) + mockget = self.mockobject( + self.controller.shareapi, 'get', + mock.Mock(returnvalue=self.share)) + mockupdate = self.mockobject( self.controller.shareapi, 'updateaccess', - mock.Mock(returnvalue=updateshareaccess)) + mock.Mock(returnvalue=updatedaccess)) + mockview = self.mockobject( + self.controller.viewbuilder, 'view', + mock.Mock(returnvalue={'access': {'accesslevel': 'ro'}})) body = {'updateaccess': {'accesslevel': 'ro'}} - url = self.getupdaterequest() - ret = self.controller.update(url, self.access['id'], body=body) - self.assertEqual(updateshareaccess['accesslevel'], - ret['access']['accesslevel']) + req = self.getupdaterequest() + context = req.environ['manila.context'] + ret = self.controller.update(req, self.access['id'], body=body) + + self.assertEqual('ro', ret['access']['accesslevel']) + mockgetaccess.assertcalledoncewith( + context, self.access['id']) + mockget.assertcalledoncewith( + context, self.share['id'], formodification=True) + mockupdate.assertcalledoncewith( + context, self.share, fakeaccess, {'accesslevel': 'ro'}) + mockview.assertcalledoncewith(req, updatedaccess) + + def testupdatepolicynotauthorized(self): + fakeaccess = mock.Mock( + accesslevel='rw', shareid=self.share['id']) + self.mockobject( + self.controller, 'getshareaccess', + mock.Mock(returnvalue=fakeaccess)) + self.mockobject( + self.controller.shareapi, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + body = {'updateaccess': {'accesslevel': 'ro'}} + req = self.getupdaterequest() + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.update, + req, self.access['id'], body=body) def testupdateaccesslevelinvalidaccesslevel(self): body = {'access': {'accesslevel': 'fakeaccess'}} diff --git a/manila/tests/api/v2/testsharebackups.py b/manila/tests/api/v2/testsharebackups.py index 7e1e820..015d0ae 100644 --- a/manila/tests/api/v2/testsharebackups.py +++ b/manila/tests/api/v2/testsharebackups.py @@ -362,19 +362,38 @@ class ShareBackupsApiTest(test.TestCase): def testcreate(self): fakebackup, expectedbackup = self.getfakebackup() + shareid = 'FAKESHAREID' body = { 'sharebackup': { - 'shareid': 'FAKESHAREID', + 'shareid': shareid, } } - self.mockobject(share.API, 'get', - mock.Mock(returnvalue={'id': 'FAKESHAREID'})) + mockget = self.mockobject( + share.API, 'get', mock.Mock(returnvalue={'id': shareid})) self.mockobject(share.API, 'createsharebackup', mock.Mock(returnvalue=fakebackup)) req = self.backupsreq resdict = self.controller.create(req, body) self.assertEqual(expectedbackup, resdict['sharebackup']) + mockget.assertcalledoncewith( + self.backupsreq.environ['manila.context'], shareid, + formodification=True) + + def testcreatepolicynotauthorized(self): + body = { + 'sharebackup': { + 'shareid': 'FAKESHAREID', + } + } + self.mockobject( + share.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises(exception.PolicyNotAuthorized, + self.controller.create, + self.backupsreq, body) def testdeleteinvalidbackup(self): fakeexception = exception.ShareBackupNotFound( diff --git a/manila/tests/api/v2/testshareexportlocations.py b/manila/tests/api/v2/testshareexportlocations.py index 65d4e22..f96829f 100644 --- a/manila/tests/api/v2/testshareexportlocations.py +++ b/manila/tests/api/v2/testshareexportlocations.py @@ -339,7 +339,8 @@ class ShareExportLocationsAPITest(test.TestCase): self.assertEqual(body, res) mockvalidate.assertcalledoncewith(req, elid, body['metadata'], delete=False) - mockcreate.assertcalledoncewith(req, elid, body) + mockcreate.assertcalledoncewith( + req, elid, body, parentid=self.share['id']) def testupdateallmetadata(self): indexresult = self.controller.index(self.req, self.share['id']) @@ -361,7 +362,34 @@ class ShareExportLocationsAPITest(test.TestCase): body=body) self.assertEqual(body, res) mockvalidate.assertcalledoncewith(req, elid, body['metadata']) - mockupdate.assertcalledoncewith(req, elid, body) + mockupdate.assertcalledoncewith( + req, elid, body, parentid=self.share['id']) + + def testverifysharepublicshareskipspolicyforread(self): + publicshare = dbutils.createshare(ispublic=True) + + self.controller.verifyshare( + self.ctxt['user'], publicshare['id']) + + self.mockpolicycheck.assertnotcalled() + + def testverifysharepublicshareenforcespolicyformodification(self): + publicshare = dbutils.createshare(ispublic=True) + + self.controller.verifyshare( + self.ctxt['user'], publicshare['id'], formodification=True) + + self.mockpolicycheck.assertcalledoncewith( + self.ctxt['user'], 'share', 'get', mock.ANY, doraise=True) + + def testverifyshareprivatesharealwaysenforcespolicy(self): + privateshare = dbutils.createshare(ispublic=False) + + self.controller.verifyshare( + self.ctxt['user'], privateshare['id']) + + self.mockpolicycheck.assertcalledoncewith( + self.ctxt['user'], 'share', 'get', mock.ANY, doraise=False) def testdeletemetadata(self): indexresult = self.controller.index(self.req, self.share['id']) @@ -375,4 +403,5 @@ class ShareExportLocationsAPITest(test.TestCase): version="2.87", useadmincontext=True) self.controller.deletemetadata(req, self.share['id'], elid, 'fakekey') - mockdelete.assertcalledoncewith(req, elid, 'fakekey') + mockdelete.assertcalledoncewith( + req, elid, 'fakekey', parentid=self.share['id']) diff --git a/manila/tests/api/v2/testsharereplicas.py b/manila/tests/api/v2/testsharereplicas.py index 4936a99..4ca7f21 100644 --- a/manila/tests/api/v2/testsharereplicas.py +++ b/manila/tests/api/v2/testsharereplicas.py @@ -384,6 +384,43 @@ class ShareReplicasApiTest(test.TestCase): self.mockpolicycheck.assertcalledoncewith( self.membercontext, self.resourcename, 'create') + def testcreatesharefromotherprojectnotfound(self): + # A share that belongs to another project is not visible to the + # caller, so the ownership lookup must fail with 404. + body = { + 'sharereplica': { + 'shareid': 'FAKESHAREID', + 'availabilityzone': 'FAKEAZ' + } + } + self.mockobject(share.API, 'get', + mock.Mock(sideeffect=exception.NotFound)) + + self.assertRaises(exc.HTTPNotFound, + self.controller.create, + self.replicasreq, body) + self.mockpolicycheck.assertcalledoncewith( + self.membercontext, self.resourcename, 'create') + + def testcreatesharefromotherprojectnotauthorized(self): + # A public share that belongs to another project: the ownership + # policy check inside the share lookup must raise + # PolicyNotAuthorized, which the WSGI layer converts to 403. + body = { + 'sharereplica': { + 'shareid': 'FAKESHAREID', + 'availabilityzone': 'FAKEAZ' + } + } + self.mockobject(share.API, 'get', mock.Mock( + sideeffect=exception.PolicyNotAuthorized(action='share:get'))) + + self.assertRaises(exception.PolicyNotAuthorized, + self.controller.create, + self.replicasreq, body) + self.mockpolicycheck.assertcalledoncewith( + self.membercontext, self.resourcename, 'create') + def testcreatehasbeensoftdeleted(self): shareref = fakeshare.fakeshare(issoftdeleted=True) body = { @@ -395,7 +432,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=shareref)) self.assertRaises(exc.HTTPForbidden, @@ -416,7 +453,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=shareref)) self.assertRaises(exc.HTTPForbidden, @@ -442,7 +479,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(sharereplicas.db, 'sharenetworkget', mock.Mock(sideeffect=exception.ShareNetworkNotFound( @@ -471,7 +508,7 @@ class ShareReplicasApiTest(test.TestCase): } } excargs = {'id': 'xyz', 'reason': 'abc'} - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(share.API, 'createsharereplica', mock.Mock(sideeffect=exceptiontype(excargs))) @@ -513,7 +550,7 @@ class ShareReplicasApiTest(test.TestCase): if self.ismicroversionge(microversion, '2.95'): body["sharereplica"].update({"metadata": {"foo": "bar"}}) - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(share.API, 'createsharereplica', mock.Mock(returnvalue=fakereplica)) diff --git a/manila/tests/api/v2/testshares.py b/manila/tests/api/v2/testshares.py index 170f825..531db4c 100644 --- a/manila/tests/api/v2/testshares.py +++ b/manila/tests/api/v2/testshares.py @@ -1995,8 +1995,14 @@ class ShareAPITest(test.TestCase): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', version='2.69') body = {"softdelete": None} + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=self.share)) + resp = self.controller.sharesoftdelete(req, 1, body=body) + self.assertEqual(202, resp.statusint) + mockget.assertcalledoncewith( + req.environ['manila.context'], 1, formodification=True) def testsharesoftdeletehasbeensoftdeletedalready(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', @@ -2029,10 +2035,15 @@ class ShareAPITest(test.TestCase): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', version='2.69') body = {"restore": None} - self.mockobject(shareapi.API, 'get', - mock.Mock(returnvalue=self.shareinrecyclebin)) + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(returnvalue=self.shareinrecyclebin)) + resp = self.controller.sharerestore(req, 1, body=body) + self.assertEqual(202, resp.statusint) + mockget.assertcalledoncewith( + req.environ['manila.context'], 1, formodification=True) def testsharerestorewithdeletingstatus(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', @@ -2045,6 +2056,34 @@ class ShareAPITest(test.TestCase): webob.exc.HTTPForbidden, self.controller.sharerestore, req, 1, body=body) + def testsharesoftdeletepolicynotauthorized(self): + req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', + version='2.69') + body = {"softdelete": None} + self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.sharesoftdelete, + req, 1, body=body) + + def testsharerestorepolicynotauthorized(self): + req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', + version='2.69') + body = {"restore": None} + self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.sharerestore, + req, 1, body=body) + def testsharedelete(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1') resp = self.controller.delete(req, 1) @@ -2975,7 +3014,8 @@ class ShareActionsTest(test.TestCase): mock.Mock(returnvalue={'fake': 'fake'})) self.mockobject(self.controller.accessviewbuilder, 'view', mock.Mock(returnvalue={'access': {'fake': 'fake'}})) - self.mockobject(shareapi.API, 'get', mock.Mock(returnvalue=share)) + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=share)) id = 'fakeshareid' body = {'os-allowaccess': access} @@ -2985,6 +3025,8 @@ class ShareActionsTest(test.TestCase): res = self.controller.allowaccess(req, id, body) self.assertEqual(expected, res) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) self.mockpolicycheck.assertcalledoncewith( req.environ['manila.context'], 'share', 'allowaccess') @@ -3249,7 +3291,8 @@ class ShareActionsTest(test.TestCase): self.mockobject(shareapi.API, "accessget", fakeaccessget) sharenetwork = dbutils.createsharenetwork() share = dbutils.createshare(sharenetworkid=sharenetwork['id']) - self.mockobject(shareapi.API, 'get', mock.Mock(returnvalue=share)) + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=share)) self.mockobject(self.controller, 'checkforaccessrulelocks') id = 'fakeshareid' @@ -3260,12 +3303,15 @@ class ShareActionsTest(test.TestCase): res = self.controller.denyaccess(req, id, body) self.assertEqual(202, res.statusint) + context = req.environ['manila.context'] + mockget.asserthascalls([ + mock.call(context, id, formodification=True), + mock.call(context, id), + ]) self.controller.checkforaccessrulelocks.assertcalledoncewith( - req.environ['manila.context'], accessdata, - accessdata['accessid'], id - ) + context, accessdata, accessdata['accessid'], id) self.mockpolicycheck.assertcalledoncewith( - req.environ['manila.context'], 'share', 'denyaccess') + context, 'share', 'denyaccess') def testdenyaccessnotfound(self): def stubdenyaccess(args, kwargs): @@ -3307,6 +3353,40 @@ class ShareActionsTest(test.TestCase): context, body['denyaccess'], bodydata['accessid'], id ) + def testallowaccesspolicynotauthorizedformodification(self): + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + id = 'fakeshareid' + body = {'os-allowaccess': { + 'accesstype': 'ip', 'accessto': '127.0.0.1'}} + req = fakes.HTTPRequest.blank( + '/v2/tenant1/shares/%s/action' % id) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.allowaccess, req, id, body) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) + + def testdenyaccesspolicynotauthorizedformodification(self): + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + self.mockobject(self.controller, 'checkforaccessrulelocks') + id = 'fakeshareid' + body = {"os-denyaccess": {"accessid": 'fakeaccesid'}} + req = fakes.HTTPRequest.blank( + '/v2/tenant1/shares/%s/action' % id) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.denyaccess, req, id, body) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) + def testcheckforaccessrulelocksnolocks(self): self.mockobject( resourcelocks.API, "getall", mock.Mock(returnvalue=([], 0))) diff --git a/manila/tests/share/testapi.py b/manila/tests/share/testapi.py index cbf2050..2183a05 100644 --- a/manila/tests/share/testapi.py +++ b/manila/tests/share/testapi.py @@ -3414,6 +3414,64 @@ class ShareAPITestCase(test.TestCase): ctx, 'share', 'get', share, doraise=False) dbapi.shareget.assertcalledoncewith(ctx, share['id']) + def testgetpublicshareskipspolicycheck(self): + fakeshare = dbutils.createshare(ispublic=True) + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + + result = self.api.get(self.context, 'fakeid') + + self.assertEqual(fakeshare, result) + shareapi.policy.checkpolicy.assertnotcalled() + + def testgetpublicshareformodificationcheckspolicy(self): + fakeshare = dbutils.createshare(ispublic=True) + shareapi.policy.checkpolicy.returnvalue = True + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + + result = self.api.get( + self.context, 'fakeid', formodification=True) + + self.assertEqual(fakeshare, result) + shareapi.policy.checkpolicy.assertcalledoncewith( + self.context, 'share', 'get', fakeshare, doraise=True) + + def testgetpublicshareformodificationnotauthorized(self): + fakeshare = dbutils.createshare( + ispublic=True, + projectid='df6d65cc1f8946ba86be06b8140ec4b3') + self.mockobject( + shareapi.policy, 'checkpolicy', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + ctx = context.RequestContext('fakeuid', 'fakepid', isadmin=False) + + self.assertRaises(exception.PolicyNotAuthorized, + self.api.get, + ctx, + fakeshare['id'], + formodification=True) + + def testgetprivateshareformodificationnotauthorized(self): + fakeshare = dbutils.createshare( + ispublic=False, + projectid='df6d65cc1f8946ba86be06b8140ec4b3') + shareapi.policy.checkpolicy.returnvalue = False + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + ctx = context.RequestContext('fakeuid', 'fakepid', isadmin=False) + + self.assertRaises(exception.NotFound, + self.api.get, + ctx, + fakeshare['id'], + formodification=True) + shareapi.policy.checkpolicy.assertcalledoncewith( + ctx, 'share', 'get', fakeshare, doraise=False) + @mock.patch.object(dbapi, 'sharesnapshotgetallbyproject', mock.Mock()) def testgetallsnapshotsadminnotalltenants(self): diff --git a/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml b/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml new file mode 100644 index 0000000..8709e6e --- /dev/null +++ b/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml @@ -0,0 +1,11 @@ +--- +security: + - | + Any user was able to manipulate the access rules, create backups or + replicas, soft delete or restore public shares they did not own, + and read or manipulate the export location metadata of shares they + did not own. These operations now enforce ownership, and export + location metadata is scoped to the share in the request URL. For + details, see Launchpad bug #2161412 + <https://bugs.launchpad.net/manila/+bug/2161412> and Launchpad + bug #2168962 <https://bugs.launchpad.net/manila/+bug/2168962>. -- 2.54.0 (Apple Git-157) #+endsrc

1 / 2
Source: Red Hat
First published (updated )

Description: Chen YuXiang from the Institute of Computing Technology, Chinese Academy of Sciences reported a vulnerability in Manila's public share authorization handling. The "ispublic" flag grants a share API visibility to all projects without transferring management authority, and the controller authorizes write operations against the caller's own project rather than the target share's project. By performing management operations on a public share owned by another project, a project member may add, update, or revoke access rules, modify export-location metadata, create backups or replicas, and soft-delete or restore the share, resulting in unauthorized cross-project data access and the potential to deny the owner access to their own share. Only deployments in which at least one share is marked public are affected.

Proposed patch: See attached patches. Unless a flaw is discovered in them, these patches will be merged to their corresponding branches on the public disclosure date. One patch targets manila-tempest-plugin: it updates two negative tests to expect 404 instead of 403 for unauthorized access to another project's share, matching the corrected authorization behavior; it will follow the core fixes once they merge.

CVE: CVE-2026-71195

Proposed public disclosure date/time: 2026-10-20, 1500UTC Please do not make the issue public (or release public patches) before this coordinated embargo date.

Original private report: https://launchpad.net/bugs/2161412 For access to read and comment on this report, please reply to me with your Launchpad username and I will subscribe you.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

Patch From 9c862f231be81c9b0dfa2645cbcd0dab7e0d6a40 Mon Sep 17 00:00:00 2001 From: Carlos da Silva <ces.eduardo98> Date: Fri, 7 Aug 2026 20:55:09 -0300 Subject: [PATCH] Fix policy control for public shares

A public share is visible to all tenants, but users other than the owner should not be able to modify it. Several operations skipped the ownership policy check for public shares. Also, the export location metadata endpoints resolved the export location globally, instead of within the share in the request URL.

This commit enforces the ownership checks when manipulating access rules, creating backups or replicas, and soft deleting or restoring public shares. Export location metadata operations are now scoped to the share in the request URL; export locations that do not belong to that share now return 404.

Change-Id: Ie283dce157f9c90f5d2ab38c1e74daa7df3ac118 Signed-off-by: Carlos da Silva <ces.eduardo98> Closes-Bug: #2161412 Closes-Bug: #2168962

#+beginsrc diff --- manila/api/v2/metadata.py | 5 +- manila/api/v2/shareaccesses.py | 3 +- manila/api/v2/sharebackups.py | 3 +- manila/api/v2/shareexportlocations.py | 35 ++++--- manila/api/v2/sharereplicas.py | 3 +- manila/api/v2/shares.py | 8 +- manila/share/api.py | 8 +- manila/tests/api/v2/testmetadata.py | 41 ++++++++ manila/tests/api/v2/testshareaccesses.py | 55 +++++++++-- manila/tests/api/v2/testsharebackups.py | 25 ++++- .../api/v2/testshareexportlocations.py | 35 ++++++- manila/tests/api/v2/testsharereplicas.py | 47 ++++++++- manila/tests/api/v2/testshares.py | 96 +++++++++++++++++-- manila/tests/share/testapi.py | 58 +++++++++++ ...cks-on-public-shares-6cb60f669bb20f6c.yaml | 11 +++ 15 files changed, 380 insertions(+), 53 deletions(-) create mode 100644 releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml

diff --git a/manila/api/v2/metadata.py b/manila/api/v2/metadata.py index 174be16..ad07ec4 100644 --- a/manila/api/v2/metadata.py +++ b/manila/api/v2/metadata.py @@ -99,7 +99,10 @@ class MetadataController(object): getresmethod = getattr( db, self.resourceget[self.resourcename]) if parentid is not None: - kwargs["parentid"] = parentid + if self.resourcename == 'shareexportlocation': + kwargs["shareid"] = parentid + else: + kwargs["parentid"] = parentid if self.resourcename == 'sharereplica': kwargs['withsharedata'] = True res = getresmethod(context, resourceid, kwargs) diff --git a/manila/api/v2/shareaccesses.py b/manila/api/v2/shareaccesses.py index 78148a5..ece6e63 100644 --- a/manila/api/v2/shareaccesses.py +++ b/manila/api/v2/shareaccesses.py @@ -168,7 +168,8 @@ class ShareAccessesController(wsgi.Controller, wsgi.AdminActionsMixin): if accesslevel == shareaccess.accesslevel: return self.viewbuilder.view(req, shareaccess) - share = self.shareapi.get(context, shareaccess.shareid) + share = self.shareapi.get( + context, shareaccess.shareid, formodification=True) values = { 'accesslevel': accesslevel, } diff --git a/manila/api/v2/sharebackups.py b/manila/api/v2/sharebackups.py index afae556..4f82c06 100644 --- a/manila/api/v2/sharebackups.py +++ b/manila/api/v2/sharebackups.py @@ -158,7 +158,8 @@ class ShareBackupController(wsgi.Controller, wsgi.AdminActionsMixin): raise exc.HTTPBadRequest(explanation=msg) try: - share = self.shareapi.get(context, shareid) + share = self.shareapi.get( + context, shareid, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPBadRequest(explanation=msg % shareid) diff --git a/manila/api/v2/shareexportlocations.py b/manila/api/v2/shareexportlocations.py index 3106d3d..48157e7 100644 --- a/manila/api/v2/shareexportlocations.py +++ b/manila/api/v2/shareexportlocations.py @@ -26,6 +26,7 @@ from manila.db import api as dbapi from manila import exception from manila.i18n import from manila import policy +from manila.share import api as shareapi LOG = log.getLogger(name) CONF = cfg.CONF @@ -43,12 +44,13 @@ class ShareExportLocationController(wsgi.Controller, self.confadminonlymetadatakeys = getattr( CONF, 'adminonlyelmetadata', [] ) + self.shareapi = shareapi.API() - def verifyshare(self, context, shareid): + def verifyshare(self, context, shareid, formodification=False): try: - share = dbapi.shareget(context, shareid) - if not share['ispublic']: - policy.checkpolicy(context, 'share', 'get', share) + self.shareapi.get( + context, shareid, formodification=formodification + ) except exception.NotFound: msg = ("Share '%s' not found.") % shareid raise exc.HTTPNotFound(explanation=msg) @@ -165,7 +167,7 @@ class ShareExportLocationController(wsgi.Controller, """Returns the list of metadata for a given share export location.""" context = req.environ['manila.context'] self.verifyshare(context, shareid) - return self.indexmetadata(req, resourceid) + return self.indexmetadata(req, resourceid, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -178,8 +180,9 @@ class ShareExportLocationController(wsgi.Controller, delete=False) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.createmetadata(req, resourceid, body) + self.verifyshare(context, shareid, formodification=True) + return self.createmetadata( + req, resourceid, body, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -191,8 +194,9 @@ class ShareExportLocationController(wsgi.Controller, body['metadata']) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.updateallmetadata(req, resourceid, body) + self.verifyshare(context, shareid, formodification=True) + return self.updateallmetadata( + req, resourceid, body, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("updatemetadata") @@ -205,8 +209,9 @@ class ShareExportLocationController(wsgi.Controller, delete=False) body['metadata'] = metadata context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.updatemetadataitem(req, resourceid, body, key) + self.verifyshare(context, shareid, formodification=True) + return self.updatemetadataitem( + req, resourceid, body, key, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("getmetadata") @@ -216,7 +221,8 @@ class ShareExportLocationController(wsgi.Controller, """Show metadata for a given share export location.""" context = req.environ['manila.context'] self.verifyshare(context, shareid) - return self.showmetadata(req, resourceid, key) + return self.showmetadata( + req, resourceid, key, parentid=shareid) @wsgi.Controller.apiversion("2.87") @wsgi.Controller.authorize("deletemetadata") @@ -224,8 +230,9 @@ class ShareExportLocationController(wsgi.Controller, def deletemetadata(self, req, shareid, resourceid, key): """Delete metadata for a given share export location.""" context = req.environ['manila.context'] - self.verifyshare(context, shareid) - return self.deletemetadata(req, resourceid, key) + self.verifyshare(context, shareid, formodification=True) + return self.deletemetadata( + req, resourceid, key, parentid=shareid) def createresource(): diff --git a/manila/api/v2/sharereplicas.py b/manila/api/v2/sharereplicas.py index c7cce66..d29983d 100644 --- a/manila/api/v2/sharereplicas.py +++ b/manila/api/v2/sharereplicas.py @@ -206,7 +206,8 @@ class ShareReplicationController(wsgi.Controller, metadata.MetadataController, raise exc.HTTPBadRequest(explanation=msg) try: - shareref = db.shareget(context, shareid) + shareref = self.shareapi.get( + context, shareid, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPNotFound(explanation=msg % shareid) diff --git a/manila/api/v2/shares.py b/manila/api/v2/shares.py index c3c0708..0baac35 100644 --- a/manila/api/v2/shares.py +++ b/manila/api/v2/shares.py @@ -432,7 +432,7 @@ class ShareController( LOG.debug("Soft delete share with id: %s", id, context=context) try: - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) self.shareapi.softdelete(context, share) except exception.NotFound: raise exc.HTTPNotFound() @@ -457,7 +457,7 @@ class ShareController( LOG.debug("Restore share with id: %s", id, context=context) try: - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) except exception.NotFound: msg = ("No share exists with ID %s.") raise exc.HTTPNotFound(explanation=msg % id) @@ -792,7 +792,7 @@ class ShareController( accessdata = body.get('allowaccess', body.get('os-allowaccess')) if not enablemetadata: accessdata.pop('metadata', None) - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) if share.get('issoftdeleted'): msg = ("Cannot allow access for share '%s' " @@ -937,7 +937,7 @@ class ShareController( self.checkforaccessrulelocks(context, accessdata, accessid, id) - share = self.shareapi.get(context, id) + share = self.shareapi.get(context, id, formodification=True) if share.get('issoftdeleted'): msg = ("Cannot deny access for share '%s' " diff --git a/manila/share/api.py b/manila/share/api.py index 96b657a..f3ee109 100644 --- a/manila/share/api.py +++ b/manila/share/api.py @@ -2427,11 +2427,13 @@ class API(base.Base): def snapshotupdate(self, context, snapshot, fields): return self.db.sharesnapshotupdate(context, snapshot['id'], fields) - def get(self, context, shareid): + def get(self, context, shareid, formodification=False): share = self.db.shareget(context, shareid) - if not share['ispublic']: + shareispublic = share['ispublic'] + if not shareispublic or formodification: authorized = policy.checkpolicy( - context, 'share', 'get', share, doraise=False) + context, 'share', 'get', share, + doraise=shareispublic and formodification) if not authorized: raise exception.NotFound() if share['status'] in ( diff --git a/manila/tests/api/v2/testmetadata.py b/manila/tests/api/v2/testmetadata.py index d443f0c..b031afa 100644 --- a/manila/tests/api/v2/testmetadata.py +++ b/manila/tests/api/v2/testmetadata.py @@ -17,6 +17,7 @@ import webob from manila.api.v2 import metadata from manila import context +from manila import db from manila import exception from manila import policy from manila import test @@ -81,6 +82,46 @@ class MetadataAPITest(test.TestCase): policyresourceobj = mockpolicycheck.callargs[0][3] self.assertEqual(shareobj['id'], policyresourceobj['id']) + def testgetresourceexportlocationscopedtoshare(self): + # Export location lookups must be scoped to the share in the + # request URL, so that the metadata of an export location + # belonging to a different share cannot be retrieved. + self.controller.resourcename = 'shareexportlocation' + fakecontext = context.RequestContext('fake', 'fake') + exportlocation = {'id': 'fake-el-uuid'} + mockgetbyuuid = self.mockobject( + db, 'exportlocationgetbyuuid', + mock.Mock(returnvalue=exportlocation)) + + res = self.controller.getresource( + fakecontext, 'fake-el-uuid', formodification=True, + parentid='fake-share-id') + + self.assertEqual(exportlocation, res) + mockgetbyuuid.assertcalledoncewith( + fakecontext, 'fake-el-uuid', shareid='fake-share-id') + self.mockpolicycheck.assertnotcalled() + + def testgetresourceexportlocationnotinsharenotfound(self): + # An export location that does not belong to the share in the + # request URL must not be accessible, regardless of the type + # of the share it belongs to. + self.controller.resourcename = 'shareexportlocation' + fakecontext = context.RequestContext('fake', 'fake') + self.mockobject( + db, 'exportlocationgetbyuuid', + mock.Mock(sideeffect=exception.ExportLocationNotFound( + uuid='fake-el-uuid'))) + + self.assertRaises( + webob.exc.HTTPNotFound, + self.controller.getresource, + fakecontext, + 'fake-el-uuid', + formodification=True, + parentid='fake-share-id', + ) + def testcreateindexmetadata(self): url = self.getrequest() body = {'metadata': {'testkey1': 'testv1', 'testkey2': 'testv2'}} diff --git a/manila/tests/api/v2/testshareaccesses.py b/manila/tests/api/v2/testshareaccesses.py index bb84d23..0b8319f 100644 --- a/manila/tests/api/v2/testshareaccesses.py +++ b/manila/tests/api/v2/testshareaccesses.py @@ -15,7 +15,6 @@ from unittest import mock -import copy import ddt from webob import exc @@ -247,17 +246,55 @@ class ShareAccessesAPITest(test.TestCase): return req def testupdateaccesslevel(self): - updateshareaccess = copy.deepcopy(self.access) - updateshareaccess.update({'accesslevel': 'ro'}) - self.mockobject( + fakeaccess = mock.Mock( + accesslevel='rw', shareid=self.share['id']) + updatedaccess = mock.Mock( + accesslevel='ro', shareid=self.share['id']) + mockgetaccess = self.mockobject( + self.controller, 'getshareaccess', + mock.Mock(returnvalue=fakeaccess)) + mockget = self.mockobject( + self.controller.shareapi, 'get', + mock.Mock(returnvalue=self.share)) + mockupdate = self.mockobject( self.controller.shareapi, 'updateaccess', - mock.Mock(returnvalue=updateshareaccess)) + mock.Mock(returnvalue=updatedaccess)) + mockview = self.mockobject( + self.controller.viewbuilder, 'view', + mock.Mock(returnvalue={'access': {'accesslevel': 'ro'}})) body = {'updateaccess': {'accesslevel': 'ro'}} - url = self.getupdaterequest() - ret = self.controller.update(url, self.access['id'], body=body) - self.assertEqual(updateshareaccess['accesslevel'], - ret['access']['accesslevel']) + req = self.getupdaterequest() + context = req.environ['manila.context'] + ret = self.controller.update(req, self.access['id'], body=body) + + self.assertEqual('ro', ret['access']['accesslevel']) + mockgetaccess.assertcalledoncewith( + context, self.access['id']) + mockget.assertcalledoncewith( + context, self.share['id'], formodification=True) + mockupdate.assertcalledoncewith( + context, self.share, fakeaccess, {'accesslevel': 'ro'}) + mockview.assertcalledoncewith(req, updatedaccess) + + def testupdatepolicynotauthorized(self): + fakeaccess = mock.Mock( + accesslevel='rw', shareid=self.share['id']) + self.mockobject( + self.controller, 'getshareaccess', + mock.Mock(returnvalue=fakeaccess)) + self.mockobject( + self.controller.shareapi, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + body = {'updateaccess': {'accesslevel': 'ro'}} + req = self.getupdaterequest() + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.update, + req, self.access['id'], body=body) def testupdateaccesslevelinvalidaccesslevel(self): body = {'access': {'accesslevel': 'fakeaccess'}} diff --git a/manila/tests/api/v2/testsharebackups.py b/manila/tests/api/v2/testsharebackups.py index 7e1e820..015d0ae 100644 --- a/manila/tests/api/v2/testsharebackups.py +++ b/manila/tests/api/v2/testsharebackups.py @@ -362,19 +362,38 @@ class ShareBackupsApiTest(test.TestCase): def testcreate(self): fakebackup, expectedbackup = self.getfakebackup() + shareid = 'FAKESHAREID' body = { 'sharebackup': { - 'shareid': 'FAKESHAREID', + 'shareid': shareid, } } - self.mockobject(share.API, 'get', - mock.Mock(returnvalue={'id': 'FAKESHAREID'})) + mockget = self.mockobject( + share.API, 'get', mock.Mock(returnvalue={'id': shareid})) self.mockobject(share.API, 'createsharebackup', mock.Mock(returnvalue=fakebackup)) req = self.backupsreq resdict = self.controller.create(req, body) self.assertEqual(expectedbackup, resdict['sharebackup']) + mockget.assertcalledoncewith( + self.backupsreq.environ['manila.context'], shareid, + formodification=True) + + def testcreatepolicynotauthorized(self): + body = { + 'sharebackup': { + 'shareid': 'FAKESHAREID', + } + } + self.mockobject( + share.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises(exception.PolicyNotAuthorized, + self.controller.create, + self.backupsreq, body) def testdeleteinvalidbackup(self): fakeexception = exception.ShareBackupNotFound( diff --git a/manila/tests/api/v2/testshareexportlocations.py b/manila/tests/api/v2/testshareexportlocations.py index 65d4e22..f96829f 100644 --- a/manila/tests/api/v2/testshareexportlocations.py +++ b/manila/tests/api/v2/testshareexportlocations.py @@ -339,7 +339,8 @@ class ShareExportLocationsAPITest(test.TestCase): self.assertEqual(body, res) mockvalidate.assertcalledoncewith(req, elid, body['metadata'], delete=False) - mockcreate.assertcalledoncewith(req, elid, body) + mockcreate.assertcalledoncewith( + req, elid, body, parentid=self.share['id']) def testupdateallmetadata(self): indexresult = self.controller.index(self.req, self.share['id']) @@ -361,7 +362,34 @@ class ShareExportLocationsAPITest(test.TestCase): body=body) self.assertEqual(body, res) mockvalidate.assertcalledoncewith(req, elid, body['metadata']) - mockupdate.assertcalledoncewith(req, elid, body) + mockupdate.assertcalledoncewith( + req, elid, body, parentid=self.share['id']) + + def testverifysharepublicshareskipspolicyforread(self): + publicshare = dbutils.createshare(ispublic=True) + + self.controller.verifyshare( + self.ctxt['user'], publicshare['id']) + + self.mockpolicycheck.assertnotcalled() + + def testverifysharepublicshareenforcespolicyformodification(self): + publicshare = dbutils.createshare(ispublic=True) + + self.controller.verifyshare( + self.ctxt['user'], publicshare['id'], formodification=True) + + self.mockpolicycheck.assertcalledoncewith( + self.ctxt['user'], 'share', 'get', mock.ANY, doraise=True) + + def testverifyshareprivatesharealwaysenforcespolicy(self): + privateshare = dbutils.createshare(ispublic=False) + + self.controller.verifyshare( + self.ctxt['user'], privateshare['id']) + + self.mockpolicycheck.assertcalledoncewith( + self.ctxt['user'], 'share', 'get', mock.ANY, doraise=False) def testdeletemetadata(self): indexresult = self.controller.index(self.req, self.share['id']) @@ -375,4 +403,5 @@ class ShareExportLocationsAPITest(test.TestCase): version="2.87", useadmincontext=True) self.controller.deletemetadata(req, self.share['id'], elid, 'fakekey') - mockdelete.assertcalledoncewith(req, elid, 'fakekey') + mockdelete.assertcalledoncewith( + req, elid, 'fakekey', parentid=self.share['id']) diff --git a/manila/tests/api/v2/testsharereplicas.py b/manila/tests/api/v2/testsharereplicas.py index 4936a99..4ca7f21 100644 --- a/manila/tests/api/v2/testsharereplicas.py +++ b/manila/tests/api/v2/testsharereplicas.py @@ -384,6 +384,43 @@ class ShareReplicasApiTest(test.TestCase): self.mockpolicycheck.assertcalledoncewith( self.membercontext, self.resourcename, 'create') + def testcreatesharefromotherprojectnotfound(self): + # A share that belongs to another project is not visible to the + # caller, so the ownership lookup must fail with 404. + body = { + 'sharereplica': { + 'shareid': 'FAKESHAREID', + 'availabilityzone': 'FAKEAZ' + } + } + self.mockobject(share.API, 'get', + mock.Mock(sideeffect=exception.NotFound)) + + self.assertRaises(exc.HTTPNotFound, + self.controller.create, + self.replicasreq, body) + self.mockpolicycheck.assertcalledoncewith( + self.membercontext, self.resourcename, 'create') + + def testcreatesharefromotherprojectnotauthorized(self): + # A public share that belongs to another project: the ownership + # policy check inside the share lookup must raise + # PolicyNotAuthorized, which the WSGI layer converts to 403. + body = { + 'sharereplica': { + 'shareid': 'FAKESHAREID', + 'availabilityzone': 'FAKEAZ' + } + } + self.mockobject(share.API, 'get', mock.Mock( + sideeffect=exception.PolicyNotAuthorized(action='share:get'))) + + self.assertRaises(exception.PolicyNotAuthorized, + self.controller.create, + self.replicasreq, body) + self.mockpolicycheck.assertcalledoncewith( + self.membercontext, self.resourcename, 'create') + def testcreatehasbeensoftdeleted(self): shareref = fakeshare.fakeshare(issoftdeleted=True) body = { @@ -395,7 +432,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=shareref)) self.assertRaises(exc.HTTPForbidden, @@ -416,7 +453,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=shareref)) self.assertRaises(exc.HTTPForbidden, @@ -442,7 +479,7 @@ class ShareReplicasApiTest(test.TestCase): mockviewbuildercall = self.mockobject( sharereplicas.replicationview.ReplicationViewBuilder, 'detaillist') - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(sharereplicas.db, 'sharenetworkget', mock.Mock(sideeffect=exception.ShareNetworkNotFound( @@ -471,7 +508,7 @@ class ShareReplicasApiTest(test.TestCase): } } excargs = {'id': 'xyz', 'reason': 'abc'} - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(share.API, 'createsharereplica', mock.Mock(sideeffect=exceptiontype(excargs))) @@ -513,7 +550,7 @@ class ShareReplicasApiTest(test.TestCase): if self.ismicroversionge(microversion, '2.95'): body["sharereplica"].update({"metadata": {"foo": "bar"}}) - self.mockobject(sharereplicas.db, 'shareget', + self.mockobject(share.API, 'get', mock.Mock(returnvalue=fakereplica)) self.mockobject(share.API, 'createsharereplica', mock.Mock(returnvalue=fakereplica)) diff --git a/manila/tests/api/v2/testshares.py b/manila/tests/api/v2/testshares.py index 170f825..531db4c 100644 --- a/manila/tests/api/v2/testshares.py +++ b/manila/tests/api/v2/testshares.py @@ -1995,8 +1995,14 @@ class ShareAPITest(test.TestCase): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', version='2.69') body = {"softdelete": None} + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=self.share)) + resp = self.controller.sharesoftdelete(req, 1, body=body) + self.assertEqual(202, resp.statusint) + mockget.assertcalledoncewith( + req.environ['manila.context'], 1, formodification=True) def testsharesoftdeletehasbeensoftdeletedalready(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', @@ -2029,10 +2035,15 @@ class ShareAPITest(test.TestCase): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', version='2.69') body = {"restore": None} - self.mockobject(shareapi.API, 'get', - mock.Mock(returnvalue=self.shareinrecyclebin)) + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(returnvalue=self.shareinrecyclebin)) + resp = self.controller.sharerestore(req, 1, body=body) + self.assertEqual(202, resp.statusint) + mockget.assertcalledoncewith( + req.environ['manila.context'], 1, formodification=True) def testsharerestorewithdeletingstatus(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', @@ -2045,6 +2056,34 @@ class ShareAPITest(test.TestCase): webob.exc.HTTPForbidden, self.controller.sharerestore, req, 1, body=body) + def testsharesoftdeletepolicynotauthorized(self): + req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', + version='2.69') + body = {"softdelete": None} + self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.sharesoftdelete, + req, 1, body=body) + + def testsharerestorepolicynotauthorized(self): + req = fakes.HTTPRequest.blank('/v2/fake/shares/1/action', + version='2.69') + body = {"restore": None} + self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.sharerestore, + req, 1, body=body) + def testsharedelete(self): req = fakes.HTTPRequest.blank('/v2/fake/shares/1') resp = self.controller.delete(req, 1) @@ -2975,7 +3014,8 @@ class ShareActionsTest(test.TestCase): mock.Mock(returnvalue={'fake': 'fake'})) self.mockobject(self.controller.accessviewbuilder, 'view', mock.Mock(returnvalue={'access': {'fake': 'fake'}})) - self.mockobject(shareapi.API, 'get', mock.Mock(returnvalue=share)) + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=share)) id = 'fakeshareid' body = {'os-allowaccess': access} @@ -2985,6 +3025,8 @@ class ShareActionsTest(test.TestCase): res = self.controller.allowaccess(req, id, body) self.assertEqual(expected, res) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) self.mockpolicycheck.assertcalledoncewith( req.environ['manila.context'], 'share', 'allowaccess') @@ -3249,7 +3291,8 @@ class ShareActionsTest(test.TestCase): self.mockobject(shareapi.API, "accessget", fakeaccessget) sharenetwork = dbutils.createsharenetwork() share = dbutils.createshare(sharenetworkid=sharenetwork['id']) - self.mockobject(shareapi.API, 'get', mock.Mock(returnvalue=share)) + mockget = self.mockobject( + shareapi.API, 'get', mock.Mock(returnvalue=share)) self.mockobject(self.controller, 'checkforaccessrulelocks') id = 'fakeshareid' @@ -3260,12 +3303,15 @@ class ShareActionsTest(test.TestCase): res = self.controller.denyaccess(req, id, body) self.assertEqual(202, res.statusint) + context = req.environ['manila.context'] + mockget.asserthascalls([ + mock.call(context, id, formodification=True), + mock.call(context, id), + ]) self.controller.checkforaccessrulelocks.assertcalledoncewith( - req.environ['manila.context'], accessdata, - accessdata['accessid'], id - ) + context, accessdata, accessdata['accessid'], id) self.mockpolicycheck.assertcalledoncewith( - req.environ['manila.context'], 'share', 'denyaccess') + context, 'share', 'denyaccess') def testdenyaccessnotfound(self): def stubdenyaccess(args, kwargs): @@ -3307,6 +3353,40 @@ class ShareActionsTest(test.TestCase): context, body['denyaccess'], bodydata['accessid'], id ) + def testallowaccesspolicynotauthorizedformodification(self): + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + id = 'fakeshareid' + body = {'os-allowaccess': { + 'accesstype': 'ip', 'accessto': '127.0.0.1'}} + req = fakes.HTTPRequest.blank( + '/v2/tenant1/shares/%s/action' % id) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.allowaccess, req, id, body) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) + + def testdenyaccesspolicynotauthorizedformodification(self): + mockget = self.mockobject( + shareapi.API, 'get', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + self.mockobject(self.controller, 'checkforaccessrulelocks') + id = 'fakeshareid' + body = {"os-denyaccess": {"accessid": 'fakeaccesid'}} + req = fakes.HTTPRequest.blank( + '/v2/tenant1/shares/%s/action' % id) + + self.assertRaises( + exception.PolicyNotAuthorized, + self.controller.denyaccess, req, id, body) + mockget.assertcalledoncewith( + req.environ['manila.context'], id, formodification=True) + def testcheckforaccessrulelocksnolocks(self): self.mockobject( resourcelocks.API, "getall", mock.Mock(returnvalue=([], 0))) diff --git a/manila/tests/share/testapi.py b/manila/tests/share/testapi.py index cbf2050..2183a05 100644 --- a/manila/tests/share/testapi.py +++ b/manila/tests/share/testapi.py @@ -3414,6 +3414,64 @@ class ShareAPITestCase(test.TestCase): ctx, 'share', 'get', share, doraise=False) dbapi.shareget.assertcalledoncewith(ctx, share['id']) + def testgetpublicshareskipspolicycheck(self): + fakeshare = dbutils.createshare(ispublic=True) + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + + result = self.api.get(self.context, 'fakeid') + + self.assertEqual(fakeshare, result) + shareapi.policy.checkpolicy.assertnotcalled() + + def testgetpublicshareformodificationcheckspolicy(self): + fakeshare = dbutils.createshare(ispublic=True) + shareapi.policy.checkpolicy.returnvalue = True + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + + result = self.api.get( + self.context, 'fakeid', formodification=True) + + self.assertEqual(fakeshare, result) + shareapi.policy.checkpolicy.assertcalledoncewith( + self.context, 'share', 'get', fakeshare, doraise=True) + + def testgetpublicshareformodificationnotauthorized(self): + fakeshare = dbutils.createshare( + ispublic=True, + projectid='df6d65cc1f8946ba86be06b8140ec4b3') + self.mockobject( + shareapi.policy, 'checkpolicy', + mock.Mock(sideeffect=exception.PolicyNotAuthorized( + action='share:get'))) + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + ctx = context.RequestContext('fakeuid', 'fakepid', isadmin=False) + + self.assertRaises(exception.PolicyNotAuthorized, + self.api.get, + ctx, + fakeshare['id'], + formodification=True) + + def testgetprivateshareformodificationnotauthorized(self): + fakeshare = dbutils.createshare( + ispublic=False, + projectid='df6d65cc1f8946ba86be06b8140ec4b3') + shareapi.policy.checkpolicy.returnvalue = False + self.mockobject(dbapi, 'shareget', + mock.Mock(returnvalue=fakeshare)) + ctx = context.RequestContext('fakeuid', 'fakepid', isadmin=False) + + self.assertRaises(exception.NotFound, + self.api.get, + ctx, + fakeshare['id'], + formodification=True) + shareapi.policy.checkpolicy.assertcalledoncewith( + ctx, 'share', 'get', fakeshare, doraise=False) + @mock.patch.object(dbapi, 'sharesnapshotgetallbyproject', mock.Mock()) def testgetallsnapshotsadminnotalltenants(self): diff --git a/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml b/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml new file mode 100644 index 0000000..8709e6e --- /dev/null +++ b/releasenotes/notes/bug-2161412-enforce-policy-checks-on-public-shares-6cb60f669bb20f6c.yaml @@ -0,0 +1,11 @@ +--- +security: + - | + Any user was able to manipulate the access rules, create backups or + replicas, soft delete or restore public shares they did not own, + and read or manipulate the export location metadata of shares they + did not own. These operations now enforce ownership, and export + location metadata is scoped to the share in the request URL. For + details, see Launchpad bug #2161412 + <https://bugs.launchpad.net/manila/+bug/2161412> and Launchpad + bug #2168962 <https://bugs.launchpad.net/manila/+bug/2168962>. -- 2.54.0 (Apple Git-157) #+endsrc

First published (updated )

========================================================================== OSSN-0109: Cross-project metric association bypass in Gnocchi (2026-10-07) ==========================================================================

Summary ~~~~~~~ The Gnocchi metric creation endpoint allows authenticated users to associate metrics with resources owned by others by passing resourceid in the request body bypassing proper authorization checks.

This improper access control enables attackers to inject arbitrary measures Aodh alarms and Heat scaling policies across project boundaries.

Affected Services / Software ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Gnocchi (<4.6.6, ==4.7.0)

Discussion ~~~~~~~~~~ The Gnocchi API did not apply any policy when passing resourceid in the request body when creating metrics using POST /v1/metric. the resource UUID was known or could be enumerated. and thus Heat scaling policies that could trigger stack changes that causes changes in OpenStack resources on the project. This vulnerability was originally disclosed by gnocchi's upstream at https://github.com/gnocchixyz/gnocchi.

Recommended Actions ~~~~~~~~~~~~~~~~~~~ the Gnocchi API service.

Patches: Credits: swdb

Contacts / References ~~~~~~~~~~~~~~~~~~~~~ Author: Tobias Urdin (Binero)

This OSSN : https://docs.openstack.org/security-notes/OSSN-0109.html

First published (updated )

===================================================================================== =====================================================================================

:Date: October 07, 2026 :CVE: CVE-2026-107363

Affects ~~~~~~~ - Zaqar: >=1.0.0 <20.1.3, >=21.0.0 <21.0.3, >=22.0.0 <22.0.3, ==23.0.0

Description ~~~~~~~~~~~ Chen YuXiang from the Institute of Computing Technology, Chinese Academy of Sciences reported a vulnerability in Zaqar's WebSocket transport. An authenticated remote attacker who knows a target project's UUID may substitute it in subsequent WebSocket frames to enumerate, inspect, create, or delete queues belonging to that project. This may result in unauthorized disclosure, modification, or loss of queue data. Only deployments using the WebSocket transport with Keystone authentication are affected.

Errata ~~~~~~ CVE-2026-107363 has been assigned for this vulnerability.

Patches ~~~~~~~ - https://review.opendev.org/1009254 (2025.1/epoxy) - https://review.opendev.org/1009253 (2025.2/flamingo) - https://review.opendev.org/1009252 (2026.1/gazpacho) - https://review.opendev.org/1009251 (2026.2/hibiscus) - https://review.opendev.org/1009250 (2027.1/indri (development))

Credits ~~~~~~~ References ~~~~~~~~~~ - https://launchpad.net/bugs/2161402 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-107363

OSSA History ~~~~~~~~~~~~ - 2026-10-07 - Errata 1 - 2026-10-07 - Original Version

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

On 10/7/26 10:59 AM, Goutham Pacha Ravi wrote: ===================================================================================== =====================================================================================

:Date: October 07, 2026 :CVE: CVE-2026-pending

Affects ~~~~~~~ - Zaqar: >=1.0.0 <20.1.3, >=21.0.0 <21.0.3, >=22.0.0 <22.0.3, ==23.0.0

Description ~~~~~~~~~~~ Chen YuXiang from the Institute of Computing Technology, Chinese Academy of Sciences reported a vulnerability in Zaqar's WebSocket transport. An authenticated remote attacker who knows a target project's UUID may substitute it in subsequent WebSocket frames to enumerate, inspect, create, or delete queues belonging to that project. This may result in unauthorized disclosure, modification, or loss of queue data. Only deployments using the WebSocket transport with Keystone authentication are affected.

Patches ~~~~~~~ - https://review.opendev.org/1009254 (2025.1/epoxy) - https://review.opendev.org/1009253 (2025.2/flamingo) - https://review.opendev.org/1009252 (2026.1/gazpacho) - https://review.opendev.org/1009251 (2026.2/hibiscus) - https://review.opendev.org/1009250 (2027.1/indri (development))

Credits ~~~~~~~ References ~~~~~~~~~~ - https://launchpad.net/bugs/2161402 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-pending

Notes ~~~~~ - A CVE identifier was requested from MITRE for this vulnerability on   2026-10-06. The CVE will be added to this advisory by errata once   assigned.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

First published (updated )
Severity
6.1
AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X

In OpenStack Zaqar before 23.0.1, the WebSocket transport fails to bind the project identifier in subsequent requests to the project authenticated by the Keystone token. An authenticated user with a valid token for one project may substitute another project's UUID to enumerate, inspect, create, or delete queues belonging to that project, resulting in unauthorized disclosure, modification, or loss of queue data. Only deployments using the WebSocket transport with Keystone authentication are affected.

First published (updated )

===================================================================================== =====================================================================================

:Date: October 07, 2026 :CVE: CVE-2026-pending

Affects ~~~~~~~ - Zaqar: >=1.0.0 <20.1.3, >=21.0.0 <21.0.3, >=22.0.0 <22.0.3, ==23.0.0

Description ~~~~~~~~~~~ Chen YuXiang from the Institute of Computing Technology, Chinese Academy of Sciences reported a vulnerability in Zaqar's WebSocket transport. An authenticated remote attacker who knows a target project's UUID may substitute it in subsequent WebSocket frames to enumerate, inspect, create, or delete queues belonging to that project. This may result in unauthorized disclosure, modification, or loss of queue data. Only deployments using the WebSocket transport with Keystone authentication are affected.

Patches ~~~~~~~ - https://review.opendev.org/1009254 (2025.1/epoxy) - https://review.opendev.org/1009253 (2025.2/flamingo) - https://review.opendev.org/1009252 (2026.1/gazpacho) - https://review.opendev.org/1009251 (2026.2/hibiscus) - https://review.opendev.org/1009250 (2027.1/indri (development))

Credits ~~~~~~~ References ~~~~~~~~~~ - https://launchpad.net/bugs/2161402 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-pending

Notes ~~~~~ - A CVE identifier was requested from MITRE for this vulnerability on 2026-10-06. The CVE will be added to this advisory by errata once assigned.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

First published (updated )

Chen YuXiang discovered that OpenStack Aodh did not correctly enforce project scoping in its alarm list API and that the OpenStack Watcher webhook trigger endpoint did not apply authorization. An attacker could possibly use this issue to access sensitive alarm metadata or trigger unauthorized action plans.

First published (updated )
Advisory
USN-8870-1

It was discovered that OpenStack Designate did not properly validate overlapping zones under certain circumstances. An authenticated user could possibly use this issue to redirect DNS traffic to attacker-controlled systems or cause a denial of service.

First published (updated )
Advisory
USN-8860-1

Grzegorz Grasza discovered that OpenStack Keystone did not consistently enforce restrictions for delegated authentication tokens. An authenticated attacker could possibly use this issue to create credentials or delegations that outlasted the delegated token. (CVE-2026-80182) It was discovered that OpenStack Keystone incorrectly handled role assignment queries under certain circumstances. An authenticated attacker could possibly use this issue to obtain sensitive information. This issue only affected Ubuntu 20.04 LTS, Ubuntu 22.04 LTS, Ubuntu 24.04 LTS, and Ubuntu 26.04 LTS. (CVE-2026-80183) Tim Shephard discovered that OpenStack Keystone did not properly restrict reauthentication using delegated tokens. An authenticated attacker could possibly use this issue to escape their intended project scope and obtain unauthorized access. (CVE-2026-80184)

First published (updated )
Advisory
USN-8854-1
Severity
6.5
SSRF
AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N

A Server-Side Request Forgery (SSRF) vulnerability exists in the Image API (v2) of OpenStack Glance. When the showmultiplelocations configuration option is enabled in glance-api.conf, an authenticated attacker can manipulate the locations attribute of an image in the queued state by sending a crafted HTTP PATCH request

First published (updated )

======================================================================= OSSA-2026-042: Zaqar empty URL-Signature header bypasses authentication =======================================================================

:Date: September 24, 2026 :CVE: CVE-2026-97404

Affects ~~~~~~~ - Zaqar: >=1.0.0 <20.1.2, >=21.0.0 <21.0.2, >=22.0.0 <22.0.2

Description ~~~~~~~~~~~ pple, an independent security researcher, reported that Zaqar's WSGI transport mishandles an empty URL-Signature header: a request carrying the header with an empty value bypasses both Keystone authentication and pre-signed URL verification. An unauthenticated remote attacker who knows a target project's UUID can then read, enumerate, create, and delete that project's queues, messages, claims, and subscriptions. By additionally claiming an administrative role, the attacker may also perform administrative operations, such as managing pools and flavors in adminmode deployments. Only deployments using the WSGI transport with an authentication strategy configured are affected; the websocket transport is not affected.

Patches ~~~~~~~ - https://review.opendev.org/1007162 (2025.1/epoxy) - https://review.opendev.org/1007161 (2025.2/flamingo) - https://review.opendev.org/1007160 (2026.1/gazpacho) - https://review.opendev.org/1007159 (2026.2/hibiscus) - https://review.opendev.org/1007158 (2027.1/indri (development))

Credits ~~~~~~~ - pple from Independent (CVE-2026-97404)

References ~~~~~~~~~~ - https://launchpad.net/bugs/2164987 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97404

Notes ~~~~~ - This issue is distinct from the EXTRA-SPEC header bypass in OSSA-2026-029; the fix for that issue removed the EXTRA-SPEC branch but left the empty-value handling of the URL-Signature header untouched.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

======================================================================= OSSA-2026-041: Cross-container information disclosure via Swift tempurl =======================================================================

:Date: September 24, 2026 :CVE: CVE-2026-97149

Affects ~~~~~~~ Description ~~~~~~~~~~~ Oren Yomtov from ACT Security and "swdb", a security researcher, independently reported a vulnerability in the Swift tempurl middleware. A party holding a single-object PUT TempURL signed with an account-level key (X-Account-Meta-Temp-URL-Key) could resend the signed request with an X-Copy-From header naming any object in the same account, causing Swift to copy the named object into the granted destination object, and read the copied bytes back with a second GET TempURL, disclosing objects the holder of the TempURL was not authorized to access. Only deployments with the tempurl middleware enabled are affected. The copy is limited to the account that owns the key, and the attacker must know the target container and object name.

As a mitigation, operators can add x-copy-from to the incomingremoveheaders option of the [filter:tempurl] section of their proxy server configuration. With that configuration the header is silently removed and the PUT stores no data; the patches below instead reject the request with a 400 response.

Patches ~~~~~~~ - https://review.opendev.org/1007050 (2025.1/epoxy) - https://review.opendev.org/1007049 (2025.2/flamingo) - https://review.opendev.org/1007048 (2026.1/gazpacho) - https://review.opendev.org/1007047 (2026.2/hibiscus) - https://review.opendev.org/1007046 (2027.1/indri (development))

Credits ~~~~~~~ - Oren Yomtov from ACT Security - swdb from Independent

References ~~~~~~~~~~ - https://launchpad.net/bugs/2166876 - http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2026-97149

Notes ~~~~~ - This issue is distinct from the S3API vulnerabilities in OSSA-2026-030; it affects the native Swift API with the default proxy pipeline and does not require the S3API middleware or the s3acl configuration.

-- Goutham Pacha Ravi OpenStack Vulnerability Management Team https://security.openstack.org/vmt.html

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203