From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.haj.ipfire.org (localhost [IPv6:::1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4csH7q4MTWz3314 for ; Wed, 22 Oct 2025 18:02:47 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [IPv6:2001:678:b28::25]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519) (Client CN "mail01.haj.ipfire.org", Issuer "R13" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4csH7m1lV2z2xS5 for ; Wed, 22 Oct 2025 18:02:44 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4csH7L2l0Lzbc; Wed, 22 Oct 2025 18:02:22 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1761156142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uUcEQOI2I6p3iu8txxwjHGFLhEndhTwc86wnaw1zpxY=; b=6dC14eJlQkT7uukJj9F8dwEht+2qPr2+6mZ2ajzLoULmCyE82rliufkMbwDBPs+CT229ki +tVqgpNIssqlUaBA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1761156142; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uUcEQOI2I6p3iu8txxwjHGFLhEndhTwc86wnaw1zpxY=; b=GDMUQxow9cmI9w0U8yJIFbNfGXC8CHsfAfe1FXUEaI7pftKixExr4fLLfVWMDWV+nGX51k /t68ZJ4jNtZrKnT6SKzq8X23MHRJsiM6trsxQ6ek3i/9TQ9w41+6ohstNhrmozPSwNTUj5 NNR9ATVkIyKsVrZCXI3vtioM5LOUNoqJ1I6MNs7iO2hgC6JH/dX6sGgN0GI6p75AWlqkJY fCztqk6jddv3uzKRnwRk27/7O+OQEhYWg0sjaHleov5DOWKjpfPjRxOnX7uKWjOySUU5+m Ohi6fxGrSuvPfe5BlrYoWNiqkt80/2yavdQBPcxqkuy1igmXHZVyjNmaqy9i5A== Message-ID: Subject: Re: [PATCH] wlanap.cgi: Save IEEE80211W 'optional' value correctly From: ummeegge To: Michael Tremer Cc: development@lists.ipfire.org Date: Wed, 22 Oct 2025 20:02:18 +0200 In-Reply-To: <930F4556-F971-47C7-94A5-A704D30AB220@ipfire.org> References: <20251017094258.632108-1-ummeegge@ipfire.org> <930F4556-F971-47C7-94A5-A704D30AB220@ipfire.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: list List-Id: List-Subscribe: , List-Unsubscribe: , List-Post: List-Help: Sender: Mail-Followup-To: MIME-Version: 1.0 Hi Michael, hope version 2 fits the needs. Best, Erik Am Mittwoch, dem 22.10.2025 um 11:17 +0100 schrieb Michael Tremer: > Hello Erik, >=20 > Thank you for your patch. >=20 > I cannot quite merge this because the patch changes behaviour so that > the browser could write arbitrary values into the configuration file > without further sanitisation. To fix this, we must check if > $cgiparams{'IEEE80211W=E2=80=99} contains one of three possible values. >=20 > Would you like to update this patch accordingly? >=20 > -Michael >=20 > > On 17 Oct 2025, at 10:42, ummeegge wrote: > >=20 > > Original ternary ignored 'optional' and forced 'off'. > > Use defined-or (//) to preserve all select values. > >=20 > > Signed-off-by: ummeegge > > --- > > html/cgi-bin/wlanap.cgi | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > >=20 > > diff --git a/html/cgi-bin/wlanap.cgi b/html/cgi-bin/wlanap.cgi > > index 600ddc489..afdba59b3 100644 > > --- a/html/cgi-bin/wlanap.cgi > > +++ b/html/cgi-bin/wlanap.cgi > > @@ -118,7 +118,7 @@ if ($cgiparams{'ACTION'} eq > > "$Lang::tr{'save'}") { > > $wlanapsettings{'NOSCAN'} =3D ($cgiparams{'NOSCAN'} eq 'on') ? 'on' : > > 'off'; > > $wlanapsettings{'ENC'} =3D $cgiparams{'ENC'}; > > $wlanapsettings{'PWD'} =3D $cgiparams{'PWD'}; > > - $wlanapsettings{'IEEE80211W'} =3D ($cgiparams{'IEEE80211W'} eq > > 'on') ? 'on' : 'off'; > > + $wlanapsettings{'IEEE80211W'} =3D $cgiparams{'IEEE80211W'} // > > 'off'; > > $wlanapsettings{'TX_POWER'} =3D $cgiparams{'TX_POWER'}; > >=20 > > if ($errormessage eq '') { > > --=20 > > 2.47.2 > >=20 > >=20