[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#402631: marked as done (packages.debian.org: susceptible to XSS attacks)



Your message dated Mon, 11 Dec 2006 20:27:26 +0100
with message-id <20061211192725.GA29595@feynman.djpig.de>
and subject line Committed
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: www.debian.org
Version: N/A; reported 2006/12/11
Severity: minor
Tags: security

Christian Boltz reported in the debian-www mailing list [1] that the
download.pl CGI used in packages.debian.org is vulnerable to XSS attacks.
This seems to have been "discovered" by fefe [2]

I don't believe this is an awful problem, as I answered in the mailing list:

"- packages.debian.org does not have any kind of client authentication
- packages.debian.org does not use SSL certificate

this is as much a problem as somebody being able to setup a "fake"
packages.debian.org or do MITM injection.

Not that I wouldn't want to see this fixed but, really, this is as low risk
as it can get. Through XSS no one could retrieve user credentials and no one
should be trusting (in this day an age) the information from a website that
is not signed (through an SSL server-side certificate)."

Anyway, I've developed a fix for the download CGI application
(attached).  It's (slightly) tested for the content that the CGI should "see"
but it might detected as "invalid" some corner cases.

Please apply it to the CVS (I don't have write access to that area).

Regards

Javier


[1]  Message-Id: <[🔎] 200612111657.31254@tux.boltz.de.vu>
[2] http://blog.fefe.de/?ts=bb838974

Index: download.pl
===================================================================
RCS file: /cvs/webwml/packages/cgi-bin/download.pl,v
retrieving revision 1.27
diff -u -r1.27 download.pl
--- download.pl	1 Dec 2006 08:42:27 -0000	1.27
+++ download.pl	11 Dec 2006 17:49:34 -0000
@@ -182,17 +182,28 @@
 
 $file = $input->param('file');
 param_error( "file" ) unless defined $file;
+# Make file fit in a regexp
+param_invalid ("file") if  $file !~ /^[\w\%\.\_\-]+$/;
 @file_components = split('/', $file);
 $filen = pop(@file_components);
 
 $md5sum = $input->param('md5sum');
 param_error( "md5sum" ) unless defined $md5sum;
+# Make md5sum fit in a regexp
+param_invalid ("md5sum") if  $md5sum !~ /^\w{32}$/;
 
 $type = $input->param('type');
 param_error( "type" ) unless defined $type;
+# Make type fit in a regexp
+param_invalid ("type") if  $type !~ /^\w{1,10}$/;
 
 $arch = $input->param('arch');
 param_error( "arch" ) unless defined $arch;
+# Make arch fit in a regexp
+param_invalid ("arch") if  $arch !~ /^[\w\-]{1,10}$/;
+# And also check that it is in the list of supported archs
+param_invalid ("arch") if  ! defined ($arches{$arch});
+
 
 my $arch_string = $arch ne 'all' ? "on $arches{$arch} machines" : "";
 
@@ -340,3 +351,12 @@
     print "<p>If the problem persists, please inform $ENV{SERVER_ADMIN}.</p>\n";
     exit;
 }
+
+sub param_invalid {
+    my $param = shift;
+
+    print "<p>Error: Required parameter \"$param\" does not have a valid content.</p>\n";
+    print "<p>If the problem persists, please inform $ENV{SERVER_ADMIN}.</p>\n";
+    exit;
+}
+

Attachment: signature.asc
Description: Digital signature


--- End Message ---
--- Begin Message ---
The patch needed some corrections in the regexes.
Committed now.

Gruesse,
-- 
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/

--- End Message ---

Reply to: