Files
webmin/filemin/copy.cgi
Ilia Ross 04ae776e6a
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
Fix to validate action paths
* Note: Validate File Manager action name/file parameters as checked paths under the current directory and `allowed_paths` before operations, blocking traversal and symlink escapes.
2026-05-12 01:25:57 +02:00

25 lines
448 B
Perl
Executable File

#!/usr/local/bin/perl
require './filemin-lib.pl';
&ReadParse();
get_paths();
my @names = split(/\0/, $in{'name'});
foreach $name (@names) {
&validate_filename_path($name);
}
open(my $fh, ">", &get_paste_buffer_file()) or die "Error: $!";
print $fh "copy\n";
print $fh "$path\n";
#$info = "Copied ".scalar(@list)." files to buffer";
foreach $name (@names) {
print $fh "$name\n";
}
close($fh);
&redirect("index.cgi?path=".&urlize($path));