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 0E4901FF0C1 for ; Wed, 26 Aug 2026 15:04:59 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B96FB2139E; Wed, 26 Aug 2026 15:04:58 +0200 (CEST) Message-ID: <562b4d2c-4a4a-4296-804a-af6655a3171d@proxmox.com> Date: Wed, 26 Aug 2026 15:04:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH access-control] rpc: do not check malformed acl path To: Elias Huhsovitz References: <8eff67e8-ac88-4b7d-a90d-de32644d1d95@proxmox.com> <20260826103752.115037-1-e.huhsovitz@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260826103752.115037-1-e.huhsovitz@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1787749486763 X-SPAM-LEVEL: Spam detection results: 0 AWL -0.452 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) KAM_MAILER 2 Automated Mailer Tag Left in Email POISEN_SPAM_PILL 0.1 Meta: its spam POISEN_SPAM_PILL_1 0.1 random spam to be learned in bayes POISEN_SPAM_PILL_3 0.1 random spam to be learned in bayes 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: OOGHNNUHE2A2RM4HP7UPKKHE7IFTSZJJ X-Message-ID-Hash: OOGHNNUHE2A2RM4HP7UPKKHE7IFTSZJJ X-MailFrom: d.csapak@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 CC: pve-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: high level: I would not touch the acl checks here in anyway, but as I already wrote would like to do it like we do elsewhere: for example: in the 'startall' api call, we have: permissions => { user => 'all' }, so every api user can call it, but then inside the api handler we check the permission manually and do a `raise_perm_exc` so in our case here, we first check if the parameter is a pciid or a mapping, and check the permission accordingly. then we don't need to adapt the ACL part, and have still proper acl validation. does that make sense? On 8/26/26 12:37 PM, Elias Huhsovitz wrote: > Signed-off-by: Elias Huhsovitz > --- > Thank you for the feedback. I looked into this a bit more and > provided an experimental patch as a reference. > > The Problem > ----------- > The core problem is indeed the colon ':', which makes sense. > > I did some further testing and the same error occurs when sending a > request to the enpoint: > > GET /cluster/mapping/pci/{id} > > It outputs the errors: > pveproxy[42711]: Failed to normalize '/mapping/pci/0000:01:00.0' > pveproxy[42711]: internal error: ACL check called for undefined ACL path! > pveproxy[42711]: Use of uninitialized value $path in concatenation (.) or string at /usr/share/perl5/PVE/RPCEnvironment.pm line 325. > > Mismatch > --------- > I think explicitely checking the permissions in the api handler itself > will work, but to my understanding there is an underlying mismatch: > > The API schema explicitly allows colons (for raw PCI IDs), but the > ACL path normalizer explicitly rejects them. > > Proposed solution > ----------------- > IMHO providing explicit permissions on a raw PCI ID like 0000:01:00.0 > instead of a mapping should not happen (i think) and should not be > checked. > > What is your opinion on simply not checking invalid ACL > paths? > > This would cause a more graceful failure. > > Caveats > ------- > (I fear that such a check might causes problems in existing systems, > that rely on "invalid" ACL paths. But i would love to hear your input > on this) > > Side note > --------- > What aboud allowing encoded PCI IDs instead? e.g., > GET /nodes/lisa/hardware/pci/0000%3A01%3A00.0 > > Summary of changes > ------------------ > > src/PVE/RPCEnvironment.pm | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/src/PVE/RPCEnvironment.pm b/src/PVE/RPCEnvironment.pm > index 7591aa9..61ef28b 100644 > --- a/src/PVE/RPCEnvironment.pm > +++ b/src/PVE/RPCEnvironment.pm > @@ -487,7 +487,11 @@ sub exec_api2_perm_check { > } > my $path = PVE::Tools::template_replace($tmplpath, $param); > my $normpath = PVE::AccessControl::normalize_path($path); > - warn "Failed to normalize '$path'\n" if !defined($normpath) && defined($path); > + > + if (!defined($normpath)) { > + warn "Failed to normalize ACL path '$path'\n" if defined($path); > + return 0; > + } > > return $self->check_full($username, $normpath, $privs, $any, $noerr); > } elsif ($test eq 'userid-group') {