From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 68CB61FA01 for ; Fri, 26 Mar 2021 09:51:27 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 4/4] lei mark: disallow '!' in labels Date: Fri, 26 Mar 2021 09:51:26 +0000 Message-Id: <20210326095126.8184-5-e@80x24.org> In-Reply-To: <20210326095126.8184-1-e@80x24.org> References: <20210326095126.8184-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: '!' could wreak havoc if exposed to a shell like bash. It seems like a rare character for use in file/directory/mailbox names. --- lib/PublicInbox/LeiMark.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/PublicInbox/LeiMark.pm b/lib/PublicInbox/LeiMark.pm index 7a2ccf77..6d236411 100644 --- a/lib/PublicInbox/LeiMark.pm +++ b/lib/PublicInbox/LeiMark.pm @@ -23,7 +23,7 @@ my %ERR = ( my ($label) = @_; length($label) >= $L_MAX and return "`$label' too long (must be <= $L_MAX)"; - $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@\!,]*[a-z0-9]\z} ? + $label =~ m{\A[a-z0-9_][a-z0-9_\-\./\@,]*[a-z0-9]\z} ? undef : "`$label' is invalid"; }, kw => sub {