Version in base suite: 2.6.4 Base version: debbugs_2.6.4 Target version: debbugs_2.6.4+deb13u1 Base file: /srv/ftp-master.debian.org/ftp/pool/main/d/debbugs/debbugs_2.6.4.dsc Target file: /srv/ftp-master.debian.org/policy/pool/main/d/debbugs/debbugs_2.6.4+deb13u1.dsc cgi/version.cgi | 18 ++++++++---- debian/changelog | 7 ++++ patch | 76 ++++++++------------------------------------------- t/17_version_cgi.t | 12 ++++++-- t/lib/DebbugsTest.pm | 3 ++ 5 files changed, 46 insertions(+), 70 deletions(-) dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpoyqpqosf/debbugs_2.6.4.dsc: no acceptable signature found dpkg-source: warning: cannot verify inline signature for /srv/release.debian.org/tmp/tmpoyqpqosf/debbugs_2.6.4+deb13u1.dsc: no acceptable signature found diff -Nru debbugs-2.6.4/cgi/version.cgi debbugs-2.6.4+deb13u1/cgi/version.cgi --- debbugs-2.6.4/cgi/version.cgi 2024-11-11 12:04:25.000000000 +0000 +++ debbugs-2.6.4+deb13u1/cgi/version.cgi 2026-11-22 21:26:39.000000000 +0000 @@ -1,8 +1,11 @@ -#!/usr/bin/perl +#!/usr/bin/perl -T use warnings; use strict; +# Reset path since we are running in taint mode +$ENV{PATH}="/usr/local/bin:/usr/bin:/bin"; + use CGI::Simple; # by default send this message nowhere @@ -125,14 +128,19 @@ # We need to be able to rip out leaves which the versions that do not affect the current versions of unstable/testing my %sources; -@sources{map {m{(.+)/}; $1} @{$cgi_var{found}}} = (1) x @{$cgi_var{found}}; -@sources{map {m{(.+)/}; $1} @{$cgi_var{fixed}}} = (1) x @{$cgi_var{fixed}}; -@sources{map {m{(.+)/}; $1} @interesting_versions} = (1) x @interesting_versions; +@sources{ map { m{($config{package_name_re})/}; $1 } @{ $cgi_var{found} } } = + (1) x @{ $cgi_var{found} }; +@sources{ map { m{($config{package_name_re})/}; $1 } @{ $cgi_var{fixed} } } = + (1) x @{ $cgi_var{fixed} }; +@sources{ map { m{($config{package_name_re})/}; $1 } @interesting_versions } = + (1) x @interesting_versions; # at this point, we know enough to calculate the etag. my @versions_files; -foreach my $source (keys %sources) { +foreach my $source (sort keys %sources) { + next if $source !~ /^$config{package_name_re}$/; + next if $source =~ m{/}; my $srchash = substr $source, 0, 1; next unless -e "$config{version_packages_dir}/$srchash/$source"; push @versions_files, "$config{version_packages_dir}/$srchash/$source"; diff -Nru debbugs-2.6.4/debian/changelog debbugs-2.6.4+deb13u1/debian/changelog --- debbugs-2.6.4/debian/changelog 2025-02-24 17:41:48.000000000 +0000 +++ debbugs-2.6.4+deb13u1/debian/changelog 2026-11-22 21:56:28.000000000 +0000 @@ -1,3 +1,10 @@ +debbugs (2.6.4+deb13u1) trixie; urgency=medium + + [ Don Armstrong ] + * Fix arbitrary file read vulnerability in versions.cgi CVE-2026-132147 + + -- Bill Allombert Sun, 22 Nov 2026 22:56:28 +0100 + debbugs (2.6.4) unstable; urgency=medium [ Kentaro Hayashi ] diff -Nru debbugs-2.6.4/patch debbugs-2.6.4+deb13u1/patch --- debbugs-2.6.4/patch 2024-12-29 23:39:04.000000000 +0000 +++ debbugs-2.6.4+deb13u1/patch 2026-11-22 19:13:06.000000000 +0000 @@ -1,64 +1,14 @@ -diff --git a/Makefile b/Makefile -index 93ed796..5cb29cf 100644 ---- a/Makefile -+++ b/Makefile -@@ -10,6 +10,7 @@ templates_dir := $(DESTDIR)/usr/share/debbugs/templates - man_dir := $(DESTDIR)/usr/share/man - man8_dir := $(man_dir)/man8 - examples_dir := $(doc_dir)/examples -+config_dir := $(DESTDIR)/usr/share/debbugs/examples +diff --git a/t/17_version_cgi.t b/t/17_version_cgi.t +index 02370a3..2227234 100644 +--- a/t/17_version_cgi.t ++++ b/t/17_version_cgi.t +@@ -14,7 +14,8 @@ my $port = 11344; - scripts_in = $(foreach script, $(filter-out scripts/config% scripts/errorlib scripts/text, $(wildcard scripts/*)),$(patsubst scripts/%,%,$(script))) - htmls_in := $(wildcard html/*.html.in) -@@ -54,7 +55,7 @@ install_mostfiles: - $(var_dir)/indices $(var_dir)/www/cgi $(var_dir)/www/db $(var_dir)/www/txt \ - $(var_dir)/www/css \ - $(var_dir)/spool/lock $(var_dir)/spool/archive $(var_dir)/spool/incoming \ --$(var_dir)/spool/db-h $(scripts_dir) $(examples_dir) $(man8_dir); \ -+$(var_dir)/spool/db-h $(scripts_dir) $(examples_dir) $(config_dir) $(man8_dir); \ - do test -d $$dir || $(install_exec) -d $$dir; done - - # install the scripts -@@ -65,6 +66,11 @@ $(var_dir)/spool/db-h $(scripts_dir) $(examples_dir) $(man8_dir); \ - $(install_data) examples/config $(examples_dir)/config - $(install_data) examples/config.debian $(examples_dir)/config.debian - $(install_data) scripts/text $(examples_dir)/text -+ -+ $(install_data) examples/config scripts/text misc/Maintainers \ -+ misc/Maintainers.override misc/pseudo-packages.description \ -+ misc/sources misc/nextnumber $(config_dir) -+ - $(install_data) debian/crontab misc/nextnumber misc/Maintainers \ - misc/Maintainers.override misc/pseudo-packages.description \ - misc/sources $(examples_dir) -diff --git a/debian/debbugs-web.install b/debian/debbugs-web.install -index f33b234..3915eef 100644 ---- a/debian/debbugs-web.install -+++ b/debian/debbugs-web.install -@@ -1,4 +1,5 @@ - var/lib/debbugs/www/* - var/lib/debbugs/www/cgi/* - etc/debbugs/html -+usr/share/debbugs/examples/* - usr/share/debbugs/templates/* -diff --git a/debian/debbugsconfig b/debian/debbugsconfig -index 1e6bfa4..53af32e 100755 ---- a/debian/debbugsconfig -+++ b/debian/debbugsconfig -@@ -23,6 +23,7 @@ EOF - } - - $gConfigDir = "/etc/debbugs" if (!defined($gConfigDir)); -+$config_dir="/usr/share/debbugs/examples"; - &template("config", $gConfigDir); - require "$gConfigDir/config"; - unshift @INC, $gConfigDir; -@@ -83,7 +84,7 @@ sub template { - File::Path::make_path($destdir, {'mode' => 0755 }); - print "created $destdir/.\n"; - } -- system("cp /usr/share/doc/debbugs/examples/$name $destdir/$name") == 0 || -+ system("cp $config_dir/$name $destdir/$name") == 0 || - die "$!"; - print "created $destdir/$name from template.\n"; - } + my $version_cgi_handler = sub { + my $fh; +- open($fh,'-|',-e './cgi/version.cgi'? './cgi/version.cgi' : '../cgi/version.cgi'); ++ my $cgi = -e './cgi/version.cgi'? './cgi/version.cgi' : '../cgi/version.cgi'; ++ open($fh,'-|', "perl -I. -T $cgi"); + my $headers; + my $status = 200; + while (<$fh>) { diff -Nru debbugs-2.6.4/t/17_version_cgi.t debbugs-2.6.4+deb13u1/t/17_version_cgi.t --- debbugs-2.6.4/t/17_version_cgi.t 2024-11-08 09:13:06.000000000 +0000 +++ debbugs-2.6.4+deb13u1/t/17_version_cgi.t 2026-11-22 21:55:37.000000000 +0000 @@ -8,13 +8,14 @@ use lib qw(t/lib); use DebbugsTest qw(:all); -plan tests => 3; +plan tests => 4; my $port = 11344; my $version_cgi_handler = sub { my $fh; - open($fh,'-|',-e './cgi/version.cgi'? './cgi/version.cgi' : '../cgi/version.cgi'); + my $cgi = -e './cgi/version.cgi'? './cgi/version.cgi' : '../cgi/version.cgi'; + open($fh,'-|', "perl -I. -T $cgi"); my $headers; my $status = 200; while (<$fh>) { @@ -53,5 +54,12 @@ $res = $ua->request($req); ok($res->code() eq '304','If-None-Match set gives us 304 not modified'); +# Test that we can't expose other files +$req = HTTP::Request->new(GET => "http://localhost:$port/?package=abc&found=../../sentinel_file/abc&dot=1&format=dot&ignore_boring=0&collapse=0&info=0"); +$res = $ua->request($req); +# This is the CVE in version.cgi that potentially allows viewing modified +# contents of arbitrary files; test that it no longer works. +print STDERR $res->content; +ok($res->content !~ /SUPERSECRETVALUE/); diff -Nru debbugs-2.6.4/t/lib/DebbugsTest.pm debbugs-2.6.4+deb13u1/t/lib/DebbugsTest.pm --- debbugs-2.6.4/t/lib/DebbugsTest.pm 2024-11-08 09:13:06.000000000 +0000 +++ debbugs-2.6.4+deb13u1/t/lib/DebbugsTest.pm 2026-11-22 21:30:46.000000000 +0000 @@ -87,6 +87,7 @@ \$gTemplateDir='@{[getcwd()]}/templates'; \$gWebDir='@{[getcwd()]}/html'; \$gWebHost='localhost'; +\$gVersionPackagesDir='$config_dir/versions/pkg'; 1; END "$spool_dir/nextnumber" => qq(1\n), @@ -98,6 +99,8 @@ END "$config_dir/pseudo-packages.description" => '', "$config_dir/pseudo-packages.maintainers" => '', + "$config_dir/versions/pkg/abcd" => '', + "$config_dir/sentinel_file" => 'SUPERSECRETVALUE', ); while (my ($file,$contents) = each %files_to_create) { system('mkdir','-p',dirname($file));