Bugzilla – Attachment 186116 Details for
Bug 40748
Remote-Code-Execution (RCE) in update_social_data.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40748: Fix RCE in update_social_data.pl
Bug-40748-Fix-RCE-in-updatesocialdatapl.patch (text/plain), 1.52 KB, created by
Jonathan Druart
on 2025-09-04 08:40:22 UTC
(
hide
)
Description:
Bug 40748: Fix RCE in update_social_data.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-09-04 08:40:22 UTC
Size:
1.52 KB
patch
obsolete
>From 2fdc9f3d1d7514f60539873c765ed9133849abfb Mon Sep 17 00:00:00 2001 >From: Jake Deery <jake.deery@openfifth.co.uk> >Date: Wed, 3 Sep 2025 15:41:14 +0000 >Subject: [PATCH] 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> >--- > misc/cronjobs/social_data/update_social_data.pl | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/misc/cronjobs/social_data/update_social_data.pl b/misc/cronjobs/social_data/update_social_data.pl >index e0de0aa1ce8..dff5a1c4856 100755 >--- a/misc/cronjobs/social_data/update_social_data.pl >+++ b/misc/cronjobs/social_data/update_social_data.pl >@@ -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}); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40748
:
186080
|
186082
|
186111
|
186114
| 186116 |
186117
|
186924