Control: tags 1153297 + pending

Dear maintainer,

I've prepared an NMU for sympa (versioned as 6.2.76~dfsg-1.2) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should cancel it.

Regards,
Salvatore
diffstat for sympa-6.2.76~dfsg sympa-6.2.76~dfsg

 changelog                                                          |    8 
 patches/WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch |  116 ++++++++++
 patches/series                                                     |    1 
 3 files changed, 125 insertions(+)

diff -Nru sympa-6.2.76~dfsg/debian/changelog sympa-6.2.76~dfsg/debian/changelog
--- sympa-6.2.76~dfsg/debian/changelog	2026-06-07 07:23:12.000000000 +0200
+++ sympa-6.2.76~dfsg/debian/changelog	2026-11-09 17:04:32.000000000 +0100
@@ -1,3 +1,11 @@
+sympa (6.2.76~dfsg-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * WWSympa: arc: Deleted or raw message files could be fetched
+    (Closes: #1153297)
+
+ -- Salvatore Bonaccorso <[email protected]>  Mon, 09 Nov 2026 17:04:32 +0100
+
 sympa (6.2.76~dfsg-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru sympa-6.2.76~dfsg/debian/patches/WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch sympa-6.2.76~dfsg/debian/patches/WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch
--- sympa-6.2.76~dfsg/debian/patches/WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch	1970-01-01 01:00:00.000000000 +0100
+++ sympa-6.2.76~dfsg/debian/patches/WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch	2026-11-09 17:03:35.000000000 +0100
@@ -0,0 +1,116 @@
+From: IKEDA Soji <[email protected]>
+Date: Wed, 12 Aug 2026 10:43:22 +0900
+Subject: WWSympa: arc: Deleted or raw message files could be fetched.
+Origin: https://github.com/sympa-community/sympa/commit/ceda6651ea2514386d9c828605b21b584ed26bed
+Bug-Debian: https://bugs.debian.org/1153297
+Bug: https://github.com/sympa-community/sympa/pull/2068
+
+---
+ src/cgi/wwsympa.fcgi.in  | 28 ++++------------------------
+ src/lib/Sympa/Archive.pm | 13 ++++++++++---
+ 2 files changed, 14 insertions(+), 27 deletions(-)
+
+diff --git a/src/cgi/wwsympa.fcgi.in b/src/cgi/wwsympa.fcgi.in
+index 65acc0b01baa..c697613fc2cd 100644
+--- a/src/cgi/wwsympa.fcgi.in
++++ b/src/cgi/wwsympa.fcgi.in
+@@ -1003,13 +1003,6 @@ our %in_regexp = (
+     'role' => 'member|editor|owner',
+ );
+ 
+-## Regexp applied on incoming parameters (%in)
+-## This regular expression defines forbidden expressions applied on all
+-## incoming parameters
+-## Note that you can use the ^ and $ expressions to match beginning and ending
+-## of expressions
+-our %in_negative_regexp = ('arc_file' => '^(arctxt|\.)');
+-
+ # No longer used as of 6.2.19b.
+ #my %filtering;
+ 
+@@ -2089,13 +2082,6 @@ sub get_parameters {
+             $regexp = $in_regexp{'*'};
+         }
+ 
+-        my $negative_regexp;
+-        if ($pname =~ /^additional_field/) {
+-            $negative_regexp = $in_negative_regexp{'additional_field'};
+-        } elsif ($in_negative_regexp{$pname}) {
+-            $negative_regexp = $in_negative_regexp{$pname};
+-        }
+-
+         # If we are editing an HTML file in the shared, allow HTML but prevent
+         # XSS.
+         if (   $pname eq 'content'
+@@ -2113,9 +2099,7 @@ sub get_parameters {
+             }
+         }
+         foreach my $one_p (split /\0/, $in{$p}) {
+-            if ($one_p !~ /^$regexp$/s
+-                || (defined $negative_regexp && $one_p =~ /$negative_regexp/s)
+-            ) {
++            unless ($one_p =~ /\A$regexp\z/s) {
+                 add_stash('user', 'syntax_errors', {p_name => $p});
+                 wwslog(
+                     'err',
+@@ -8471,16 +8455,12 @@ sub do_arc {
+         $in{'arc_file'} = $html_metadata->{filename} if $html_metadata;
+     } else {
+         $html_metadata = $archive->html_fetch(file => $in{'arc_file'});
++        $in{'arc_file'} = $html_metadata->{filename} if $html_metadata;
+     }
+     unless ($html_metadata) {
++        print "Status: 404 Not Found\n";
+         wwslog('err', 'Unable to read HTML message <%s>', $in{'arc_file'});
+-        add_stash(
+-            'user',
+-            'month_not_found',
+-            {   'arc_file' => $in{'arc_file'},
+-                'month'    => $in{'month'},
+-            }
+-        );
++        add_stash('user', 'no_required_file');
+         return undef;
+     }
+ 
+diff --git a/src/lib/Sympa/Archive.pm b/src/lib/Sympa/Archive.pm
+index 259da076f384..8feb06631659 100644
+--- a/src/lib/Sympa/Archive.pm
++++ b/src/lib/Sympa/Archive.pm
+@@ -8,7 +8,7 @@
+ # Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ # 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
+ # Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
+-# Copyright 2018, 2019, 2020, 2021 The Sympa Community. See the
++# Copyright 2018, 2019, 2020, 2021, 2026 The Sympa Community. See the
+ # AUTHORS.md file at the top-level directory of this distribution and at
+ # <https://github.com/sympa-community/sympa.git>.
+ #
+@@ -214,7 +214,14 @@ sub html_fetch {
+     return undef unless $self->{arc_directory};
+     return undef unless $options{file};
+ 
+-    my $html_file = $self->{arc_directory} . '/' . $options{file};
++    # Omit arctxt etc.
++    return undef
++        if grep { 0 == index $_, '.' or $_ eq 'arctxt' or $_ eq 'deleted' }
++        split m{/+}, $options{file};
++    # Remove extra slashes.
++    my $file = join '/', grep {length} split m{/+}, $options{file};
++
++    my $html_file = $self->{arc_directory} . '/' . $file;
+     my $handle = IO::File->new($html_file, '<');
+ 
+     unless ($handle) {
+@@ -244,7 +251,7 @@ sub html_fetch {
+     }
+     seek $handle, 0, 0;
+     $metadata->{html_content} = do { local $RS; <$handle> };
+-    $metadata->{filename} = $options{file};
++    $metadata->{filename} = $file;
+ 
+     return $metadata;
+ }
+-- 
+2.55.0
+
diff -Nru sympa-6.2.76~dfsg/debian/patches/series sympa-6.2.76~dfsg/debian/patches/series
--- sympa-6.2.76~dfsg/debian/patches/series	2026-06-07 07:23:12.000000000 +0200
+++ sympa-6.2.76~dfsg/debian/patches/series	2026-11-09 17:03:41.000000000 +0100
@@ -1 +1,2 @@
 0001-make-gettext-up-to-date.patch
+WWSympa-arc-Deleted-or-raw-message-files-could-be-fe.patch

Reply via email to