Commit 09a46476 authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 437169: [SECURITY] Local files on the server can be attached to a bug…

Bug 437169: [SECURITY] Local files on the server can be attached to a bug (making them publicly visible) when importing bugs with -attach_path Patch By Greg Hendricks <ghendricks@novell.com> r=LpSolit, a=mkanat
parent b568a50e
......@@ -384,8 +384,13 @@ sub process_attachment() {
elsif ($encoding =~ /filename/) {
# read the attachment file
Error("attach_path is required", undef) unless ($attach_path);
my $attach_filename = $attach_path . "/" . $attach->field('data');
open(ATTACH_FH, $attach_filename) or
my $filename = $attach->field('data');
# Remove any leading path data from the filename
$filename =~ s/(.*\/|.*\\)//gs;
my $attach_filename = $attach_path . "/" . $filename;
open(ATTACH_FH, "<", $attach_filename) or
Error("cannot open $attach_filename", undef);
$attachment{'data'} = do { local $/; <ATTACH_FH> };
close ATTACH_FH;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment