https://www.debian.org/security/2016/dsa-3628 The part that effects Koha is the @INC bit The problem relates to Perl 5 ("perl") loading modules from the includes directory array ("@INC") in which the last element is the current directory ("."). For more information, see the RT ticket linked above. While the Perl Security group has attempted to mitigate some of these problems by modifying Perl Modules, it is ultimately the responsibility of the application writer to remove relative paths from @INC to assure the security / consistent behavior of their code regardless of what directory it executes from. The fix is to check if the last entry of @INC is "." and if so, to remove it as an included path. The following line, when added to the top of Perl applications, should mitigate this problem. This assumes your code is not intentionally depending on paths relative to your current working directory: BEGIN { pop @INC if $INC[-1] eq '.' } We would also like to discourage using relative paths in @INC. I only found 2 places where we set the @INC specifically inside Koha Specifically Koha/Plugins.pm: push @INC, C4::Context->config("pluginsdir"); Koha/Plugins/Handler.pm: push @INC, C4::Context->config("pluginsdir"); Potentially if someone put . as the plugins dir in the config they would leave themselves open to this. While it is unlikely anyone would do this, we may as well add a fix to protect if they did.
Created attachment 53715 [details] [review] Bug 16975 : @INC should not have '.' as its last entry To Test 1/ Try using a plugin 2/ Apply patch 3/ Test plugin still works
Created attachment 53828 [details] [review] Bug 16975 : @INC should not have '.' as its last entry To Test 1/ Try using a plugin 2/ Apply patch 3/ Test plugin still works Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Tested with the kitchen sink plugin.
Created attachment 53979 [details] [review] [PASSED QA] Bug 16975 : @INC should not have '.' as its last entry To Test 1/ Try using a plugin 2/ Apply patch 3/ Test plugin still works Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to Master - Should be in the November 2016 release. Thanks!
Pushed in 16.05. Will be in 16.05.03.
Pushed to 3.20.x will be in 3.20.14
Patch pushed to 3.22.x, will be in 3.22.10