[SCM] Debian package checker branch, squeeze, updated. 2.4.3-16-gddd5248
The following commit has been merged in the squeeze branch:
commit e8de6193a77d882001e92ea1eb12251b35eb01b8
Author: Niels Thykier <niels@thykier.net>
Date: Fri Apr 5 10:11:34 2013 +0200
coll/debian-readme: Check that usr/share/doc/<pkg> is safe
At the same time, stop looking at files in usr/doc/<pkg>.
Signed-off-by: Niels Thykier <niels@thykier.net>
diff --git a/collection/debian-readme b/collection/debian-readme
index b82b555..58c0636 100755
--- a/collection/debian-readme
+++ b/collection/debian-readme
@@ -50,6 +50,16 @@ for (@readmes) {
}
}
+if (defined $file) {
+ my $dir = 'usr/share/doc';
+ $dir = 'usr/doc' if $file =~ m{^unpacked/usr/doc/}o;
+ if (!is_ancestor_of("unpacked", "unpacked/$dir/$pkg")) {
+ # Unsafe path, stop here
+ touch_file("README.Debian");
+ return;
+ }
+}
+
if (not defined $file) {
# no README found
touch_file("README.Debian");
diff --git a/debian/changelog b/debian/changelog
index 9fd8c1d..9d98f1a 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,7 +16,7 @@ lintian (2.4.3+squeeze2) stable; urgency=low
+ [NT] Fix path traversal issue that could leak information
about the host system.
- * collection/changelog-file:
+ * collection/{changelog-file,debian-readme}:
+ [NT] Ignore files in usr/doc/<pkg>.
+ [NT] Skip collection if usr/share/doc/<pkg> is not contained
within the package root.
--
Debian package checker
Reply to: