Skip to content

Commit 8ea6f7b

Browse files
committed
[#21464023] Security: arbitrary file inclusion
Poor input cleansing can allow a well-constructed cookie to return the contents of arbitrary file system objects.
1 parent d11b325 commit 8ea6f7b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: C4/Output.pm

+1
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ sub themelanguage {
143143
if $http_accept_language;
144144
# But, if there's a cookie set, obey it
145145
$lang = $query->cookie('KohaOpacLanguage') if $query->cookie('KohaOpacLanguage');
146+
$lang =~ s/[^\p{IsAlnum}\-_]//g;
146147
# Fall back to English
147148
my @languages;
148149
if ($interface eq 'intranet') {

0 commit comments

Comments
 (0)