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 ED18B1FF0AB for ; Wed, 09 Sep 2026 14:35:06 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id B7BB9215C1; Wed, 09 Sep 2026 14:35:06 +0200 (CEST) Message-ID: <670c7deb-45b4-4ff6-bc74-ba13c9c41bbe@proxmox.com> Date: Wed, 9 Sep 2026 14:34:57 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Beta Subject: Re: [PATCH http-server 1/2] fix #8021: websocket: check length of close payload To: =?UTF-8?Q?Fabian_Gr=C3=BCnbichler?= , pve-devel@lists.proxmox.com References: <20260909120309.432116-1-f.gruenbichler@proxmox.com> Content-Language: en-US From: Dominik Csapak In-Reply-To: <20260909120309.432116-1-f.gruenbichler@proxmox.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1788957289002 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.491 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: 4PW7NGXNAXIUZK5DWZ4JKLWPB6HDDTWH X-Message-ID-Hash: 4PW7NGXNAXIUZK5DWZ4JKLWPB6HDDTWH 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 X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Reviewed-by: Dominik Csapak On 9/9/26 2:03 PM, Fabian Grünbichler wrote: > before unpacking the contained status code, otherwise the debug log might print > a warning. > > Signed-off-by: Fabian Grünbichler > --- > src/PVE/APIServer/AnyEvent.pm | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/src/PVE/APIServer/AnyEvent.pm b/src/PVE/APIServer/AnyEvent.pm > index 915d678..12701aa 100644 > --- a/src/PVE/APIServer/AnyEvent.pm > +++ b/src/PVE/APIServer/AnyEvent.pm > @@ -674,8 +674,12 @@ sub websocket_proxy { > if ($opcode == 1 || $opcode == 2) { > $reqstate->{proxyhdl}->push_write($payload) if $reqstate->{proxyhdl}; > } elsif ($opcode == 8) { > - my $statuscode = unpack("n", $payload); > - $self->dprint("websocket received close. status code: '$statuscode'"); > + if ($payload_len < 2) { > + $self->dprint("websocket received close with too short payload: $payload_len"); > + } else { > + my $statuscode = unpack("n", $payload); > + $self->dprint("websocket received close. status code: '$statuscode'"); > + } > if (my $proxyhdl = $reqstate->{proxyhdl}) { > $proxyhdl->{block_disconnect} = 1 if length $proxyhdl->{wbuf}; >