From 833a6a8f38c8b7475a863a6c8d69ed9043f08d47 Mon Sep 17 00:00:00 2001 From: CPANSec Security Scanner Bot Date: Tue, 24 Nov 2026 14:29:55 +0000 Subject: [PATCH] Net::Server::PSGI: log request errors instead of re-throwing them process_request runs header parsing and the application inside an eval. When either dies, it sends a 500 response and then dies again with the same error. Nothing above process_request catches that error: a PreFork child exits, and the Single server type, whose accept loop has no eval, ends the server. One malformed request, such as one with an unknown method, therefore kills a worker or stops a Single server. Log the error and return after sending the 500, as Net::Server::HTTP's process_request already does, so the server goes on to the next connection. Notes for deciding whether to apply this patch: - Errors from header parsing or the application no longer propagate out of process_request after the 500 response. They are logged at level 1 instead. A subclass that relied on catching them above process_request no longer sees them. - Not tested on a running server. It was checked by review and by applying it to Net-Server 2.018. - Applies on its own to Net-Server 2.018, and together with the other CPANSec patches for Net-Server 2.018 when they are applied in CVE-ID order. --- lib/Net/Server/PSGI.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Net/Server/PSGI.pm b/lib/Net/Server/PSGI.pm index 9cdda38..ea735b6 100644 --- a/lib/Net/Server/PSGI.pm +++ b/lib/Net/Server/PSGI.pm @@ -69,8 +69,8 @@ sub process_request { if (! $ok) { my $err = "$@" || "Something happened"; + $self->log(1, $err); $self->send_500($err); - die $err; } } -- 2.53.0