From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) by lore.proxmox.com (Postfix) with ESMTPS id 600691FF135 for ; Sun, 19 Apr 2026 23:08:36 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id ECCE3179E8; Sun, 19 Apr 2026 23:08:24 +0200 (CEST) From: Thomas Lamprecht To: c.ebner@proxmox.com Subject: Re: [PATCH proxmox-backup v3 13/30] api: config: allow encryption key manipulation for sync job Date: Sun, 19 Apr 2026 22:41:53 +0200 Message-ID: <20260419210610.3915597-4-t.lamprecht@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260414125923.892345-14-c.ebner@proxmox.com> References: <20260419210610.3915597-1-t.lamprecht@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1776632780550 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.001 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_VALIDITY_CERTIFIED_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_RPBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. RCVD_IN_VALIDITY_SAFE_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to Validity was blocked. See https://knowledge.validity.com/hc/en-us/articles/20961730681243 for more information. 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: HDU4DSR3E7XUJCKM2NCDL4K3QMAQRYBE X-Message-ID-Hash: HDU4DSR3E7XUJCKM2NCDL4K3QMAQRYBE X-MailFrom: t.lamprecht@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: pbs-devel@lists.proxmox.com X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Am 14.04.26 um 14:59 schrieb Christian Ebner: > diff --git a/src/api2/config/sync.rs b/src/api2/config/sync.rs > @@ -586,6 +599,12 @@ pub fn update_sync_job( > > + if let Some(associated_key) = update.associated_key { > + data.associated_key = Some(associated_key); > + } AFAICT, the create path validates each associated key via sync_user_can_access_optional_key (around line 278), but the update path here just takes them as-is. Shouldn't the same validation loop be added here? Otherwise, afaict, a user could reference keys they don't have PRIV_SYS_MODIFY access to via an update, even though create correctly prevents it. Related: the active_encryption_key access check only fires when the *key* itself is being updated, not when `owner` is updated. So reassigning ownership of a sync job to a user who lacks access to the already-set active_encryption_key passes validation here but then fails at job-run time. Probably worth re-validating the currently configured key(s) against the new owner whenever `owner` changes, but it's a bit odd situation either way.