Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport of CSI: fix namespace ACL bypass on create/register APIs into release/1.9.x #24398

Conversation

hc-github-team-nomad-core
Copy link
Contributor

Backport

This PR is auto-generated from #24396 to be assessed for backporting due to the inclusion of the label backport/1.9.x.

The below text is copied from the body of the original PR.


When creating or registering a CSI volume, the RPC handler uses the volume specification's namespace instead of the request namespace. This works as intended, but the ACL check is only on the request namespace.

This allows a cross-namespace ACL bypass for authenticated users who have csi-write-volume capabilities in one namespace but not another namespace. Such a user can set the volume specification to a forbidden namespace while setting the -namespace flag in the CLI or API. The ACL check happens against the namespace they do have permission to, but the volume is created in the forbidden namespace.

This changeset fixes the bug by moving the namespace check into the loop over the volumes being written by the RPCs. It also updates the tests to better cover ACL checking in these two RPCs.

Ref: CVE-2024-10975
Ref: https://hashicorp.atlassian.net/browse/SECVULN-15463
Fixes: #24397


Overview of commits

@vercel vercel bot temporarily deployed to Preview – nomad-ui November 7, 2024 19:51 Inactive
@tgross tgross merged commit e10cb19 into release/1.9.x Nov 7, 2024
19 of 20 checks passed
@tgross tgross deleted the backport/b-csi-acl-namespace-confusion/vigorously-tight-grouse branch November 7, 2024 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants