From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <s.sterz@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 8589B94C89
 for <pbs-devel@lists.proxmox.com>; Fri, 23 Feb 2024 10:27:00 +0100 (CET)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 68A0215279
 for <pbs-devel@lists.proxmox.com>; Fri, 23 Feb 2024 10:26:30 +0100 (CET)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pbs-devel@lists.proxmox.com>; Fri, 23 Feb 2024 10:26:29 +0100 (CET)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id AA40044EB7
 for <pbs-devel@lists.proxmox.com>; Fri, 23 Feb 2024 10:26:29 +0100 (CET)
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Fri, 23 Feb 2024 10:26:29 +0100
Message-Id: <CZCCNAB9OJFF.1LOAN73CG7LRU@proxmox.com>
From: "Stefan Sterz" <s.sterz@proxmox.com>
To: "Proxmox Backup Server development discussion"
 <pbs-devel@lists.proxmox.com>
X-Mailer: aerc 0.17.0-57-g782a17dfb056
References: <20240215152001.269490-1-s.sterz@proxmox.com>
 <20240215152001.269490-10-s.sterz@proxmox.com>
 <b85af224-114b-453f-a742-8b514234191c@proxmox.com>
In-Reply-To: <b85af224-114b-453f-a742-8b514234191c@proxmox.com>
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.079 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
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pbs-devel] [PATCH proxmox-backup 09/12] auth: move to hmac
 keys for csrf tokens
X-BeenThere: pbs-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox Backup Server development discussion
 <pbs-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pbs-devel/>
List-Post: <mailto:pbs-devel@lists.proxmox.com>
List-Help: <mailto:pbs-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pbs-devel>, 
 <mailto:pbs-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Fri, 23 Feb 2024 09:27:00 -0000

On Mon Feb 19, 2024 at 7:55 PM CET, Max Carrara wrote:
> On 2/15/24 16:19, Stefan Sterz wrote:
> > previously we used a self-rolled implementation for csrf tokens. while
> > it's unlikely to cause issues in reality, as csrf tokens are only
> > valid for a given tickets lifetime, there are still theoretical
> > attacks on our implementation. so move all of this code into the
> > proxmox-auth-api crate and use hmac instead.
> >
> > this change should not impact existing installations for now, as this
> > falls back to the old implementation if a key is already present. hmac
> > keys will only be used for new installations and if users manually
> > remove the old key and
> >
> > Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
> > ---
> > note that the fallbacks here and in `proxmox-auth-api` should be remove=
d
> > with the next (major) version if possible. [...]
>
> As mentioned in my reply to patch 04, we should somehow ensure that this
> removed with some kind of compile time check or similar, so we *really*
> don't miss it.
>

yeah, as stated before, that makes sense but imo should be worked out
separatelly from this series.

-- >8 snip 8< --