From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id D172C1FF0BC for ; Thu, 29 Oct 2026 11:31:22 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 397692126A; Thu, 29 Oct 2026 11:31:20 +0100 (CET) From: Fiona Ebner To: pve-devel@lists.proxmox.com Subject: [PATCH container] fix #8237: delete read restricted options: fix calls to check_vm_perm Date: Thu, 29 Oct 2026 11:30:51 +0100 Message-ID: <20261029103113.57887-1-f.ebner@proxmox.com> X-Mailer: git-send-email 2.47.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1793269876750 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.331 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: 3OQWALUTPSNYX2VYYJOBMJXJJZD27FCP X-Message-ID-Hash: 3OQWALUTPSNYX2VYYJOBMJXJJZD27FCP X-MailFrom: f.ebner@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The checks are supposed to pass $noerr=1, but instead passed $any=1. Therefore, GET requests for '/config' and '/pending' by a user without 'VM.Config.Options' would fail for containers with 'env' set instead of deleting the key from the result. Fixes: 9ec1a04 ("api: config: censor env property for users without VM.Config.Options") Signed-off-by: Fiona Ebner --- src/PVE/LXC.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PVE/LXC.pm b/src/PVE/LXC.pm index 44ae4fa..4afa391 100644 --- a/src/PVE/LXC.pm +++ b/src/PVE/LXC.pm @@ -1639,7 +1639,7 @@ sub delete_read_restricted_options { for my ($restricted_key, $required_priv) ($options_with_restricted_read->%*) { my $has_no_access = 0; if (exists($conf->{$restricted_key})) { - if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1)) { + if (!$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1)) { $has_no_access = 1; delete $conf->{$restricted_key}; } @@ -1647,7 +1647,7 @@ sub delete_read_restricted_options { if (exists($conf->{pending}) && exists($conf->{pending}->{$restricted_key})) { if ( $has_no_access - || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], 1) + || !$rpcenv->check_vm_perm($authuser, $vmid, $pool, [$required_priv], undef, 1) ) { delete $conf->{pending}->{$restricted_key}; } -- 2.47.3