Bug 40748: Fix RCE in update_social_data.pl
This patch fixes an identified RCE in the update_social_data.pl
social_data, which when executed, allows an attacker to run arbitrary
code on the system's shell.
TO TEST:
a) In the Babeltheque_url_update syspref, wrap any bash in $(), and then
run the update_social_data.pl script.
*) For example, $(whoami >
/tmp/rce.log) will output to a file the username the perl script is
running as.
APPLY PATCH
b) Run the update_social_data.pl script again. The string is now
meta-escaped, and the RCE no longer works.
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
66e8f837dd
commit
19174500e9
|
|
@ -6,7 +6,7 @@ use Koha::Script -cron;
|
|||
use C4::Context;
|
||||
use C4::SocialData;
|
||||
|
||||
my $url = C4::Context->preference("Babeltheque_url_update");
|
||||
my $url = quotemeta( C4::Context->preference("Babeltheque_url_update") );
|
||||
my $output_dir = qq{/tmp};
|
||||
my $output_filepath = qq{$output_dir/social_data.csv};
|
||||
system(qq{/bin/rm -f $output_filepath});
|
||||
|
|
|
|||
Loading…
Reference in New Issue