--- Begin Message ---
Package: sympa
Severity: grave
Tags: fixed-upstream security patch
Hello,
A security vulnerability has been identified in WWSympa before version 6.2.80
Due to a flaw in how message file paths are handled in the archive
component (arc), unauthenticated or unauthorized users could
potentially fetch deleted or raw message files that should not be accessible.
This issue has been fixed upstream in 6.2.80 via:
https://github.com/sympa-community/sympa/pull/2068
There is no CVE identifier assigned yet, but we have been informed of
active exploitation / real-world attacks using this vulnerability.
This issue affects all current versions in Debian.
We have backported the upstream patch for Debian versions 10, 11, 12,
and 13. The corresponding patches are attached to this report.
Thanks for maintaining Sympa in Debian!
Regards,
--
Grégory Colpart - Gérant Evolix - Clé OpenPGP : 0x44975278B8612B5D
Evolix - Hébergement et Infogérance Open Source
Marseille (37 rue Guibal, Pôle Média, 13003) / Paris / Montréal
https://evolix.com | mastodon.evolix.org/@evolix | blog.evolix.com
--- a/usr/share/sympa/lib/Sympa/Archive.pm
+++ b/usr/share/sympa/lib/Sympa/Archive.pm
@@ -212,8 +212,15 @@
return undef unless $self->{arc_directory};
return undef unless $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 $handle =
- IO::File->new($self->{arc_directory} . '/' . $options{file}, '<');
+ IO::File->new($self->{arc_directory} . '/' . $file, '<');
return undef unless $handle;
my $metadata = {}; # May be empty.
@@ -235,7 +242,7 @@
}
seek $handle, 0, 0;
$metadata->{html_content} = do { local $RS; <$handle> };
- $metadata->{filename} = $options{file};
+ $metadata->{filename} = $file;
return $metadata;
}
--- a/usr/lib/cgi-bin/sympa/wwsympa.fcgi
+++ b/usr/lib/cgi-bin/sympa/wwsympa.fcgi
+++ /usr/lib/cgi-bin/sympa/wwsympa.fcgi 2026-11-06 23:52:31.709276819 +0100
@@ -997,13 +997,6 @@
'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;
@@ -2158,13 +2151,6 @@
$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'
@@ -2182,9 +2168,7 @@
}
}
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) {
Sympa::WWW::Report::reject_report_web('user', 'syntax_errors',
{p_name => $p},
'', '');
@@ -8731,16 +8715,15 @@
$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'});
Sympa::WWW::Report::reject_report_web(
'user',
- 'arc_not_found', #FIXME: Not implemented.
- { 'arc_file' => $in{'arc_file'},
- 'month' => $in{'month'},
- 'listname' => $param->{'list'}
- },
+ 'no_required_file',
+ {},
$param->{'action'},
$list,
$param->{'user'}{'email'},
--- a/usr/share/sympa/lib/Sympa/Archive.pm
+++ b/usr/share/sympa/lib/Sympa/Archive.pm
@@ -215,7 +215,14 @@
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) {
@@ -245,7 +252,7 @@
}
seek $handle, 0, 0;
$metadata->{html_content} = do { local $RS; <$handle> };
- $metadata->{filename} = $options{file};
+ $metadata->{filename} = $file;
return $metadata;
}
--- a/usr/lib/cgi-bin/sympa/wwsympa.fcgi
+++ b/usr/lib/cgi-bin/sympa/wwsympa.fcgi
@@ -997,13 +997,6 @@
'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;
@@ -2132,13 +2125,6 @@
$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'
@@ -2156,9 +2142,8 @@
}
}
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) {
+
Sympa::WWW::Report::reject_report_web('user', 'syntax_errors',
{p_name => $p},
'', '');
@@ -8741,16 +8726,15 @@
$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'});
Sympa::WWW::Report::reject_report_web(
'user',
- 'arc_not_found', #FIXME: Not implemented.
- { 'arc_file' => $in{'arc_file'},
- 'month' => $in{'month'},
- 'listname' => $param->{'list'}
- },
+ 'no_required_file',
+ {},
$param->{'action'},
$list,
$param->{'user'}{'email'},
--- a/usr/share/sympa/lib/Sympa/Archive.pm
+++ b/usr/share/sympa/lib/Sympa/Archive.pm
@@ -214,7 +214,14 @@
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 @@
}
seek $handle, 0, 0;
$metadata->{html_content} = do { local $RS; <$handle> };
- $metadata->{filename} = $options{file};
+ $metadata->{filename} = $file;
return $metadata;
}
--- a/usr/lib/cgi-bin/sympa/wwsympa.fcgi
+++ b/usr/lib/cgi-bin/sympa/wwsympa.fcgi
@@ -1003,13 +1003,6 @@
'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 @@
$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 @@
}
}
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',
@@ -8486,16 +8470,12 @@
$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;
}
--- a/usr/share/sympa/lib/Sympa/Archive.pm
+++ b/usr/share/sympa/lib/Sympa/Archive.pm
@@ -214,7 +214,14 @@
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 @@
}
seek $handle, 0, 0;
$metadata->{html_content} = do { local $RS; <$handle> };
- $metadata->{filename} = $options{file};
+ $metadata->{filename} = $file;
return $metadata;
}
--- a/usr/lib/cgi-bin/sympa/wwsympa.fcgi
+++ b/usr/lib/cgi-bin/sympa/wwsympa.fcgi
@@ -955,13 +955,6 @@
'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;
@@ -2031,13 +2024,6 @@
$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'
@@ -2055,9 +2041,7 @@
}
}
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',
@@ -8368,16 +8352,12 @@
$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;
}
--- End Message ---