Bugzilla – Attachment 120482 Details for
Bug 27942
QOTD: quote CSV uploads may contain JavaScript payloads (XSS)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27942: [20.11] Prevent XSS vulnerabilities in quote-upload
Bug-27942-2011-Prevent-XSS-vulnerabilities-in-quot.patch (text/plain), 3.04 KB, created by
Jonathan Druart
on 2021-05-05 06:58:50 UTC
(
hide
)
Description:
Bug 27942: [20.11] Prevent XSS vulnerabilities in quote-upload
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-05-05 06:58:50 UTC
Size:
3.04 KB
patch
obsolete
>From 1222a0227a2cbc45a44b997c0295a13806dab902 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 May 2021 11:48:03 +0200 >Subject: [PATCH] Bug 27942: [20.11] Prevent XSS vulnerabilities in > quote-upload > >--- > .../prog/en/modules/tools/quotes-upload.tt | 3 +++ > .../intranet-tmpl/prog/en/modules/tools/quotes.tt | 14 ++++++++++++-- > 2 files changed, 15 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >index 8103d17abd8..f01dcfa02d4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes-upload.tt >@@ -148,6 +148,8 @@ > // then default to comma. > strDelimiter = (strDelimiter || ","); > >+ strData = escape_str(strData); >+ > // Create a regular expression to parse the CSV values. > var objPattern = new RegExp( > ( >@@ -274,6 +276,7 @@ > "fnDrawCallback": function(oSettings) { > /* Apply the jEditable handlers to the table on all fields w/o the no_edit id */ > $('#quotes_editor tbody td[id!="no_edit"]').editable( function(value, settings) { >+ value = escape_str(value); > var cellPosition = oTable.fnGetPosition( this ); > oTable.fnUpdate(value, cellPosition[0], cellPosition[1], false, false); > return(value); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt >index 5339069a0f6..c42f41d83a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/quotes.tt >@@ -86,8 +86,18 @@ > "sAjaxSource" : "/cgi-bin/koha/tools/quotes/quotes_ajax.pl", > "aoColumns" : [ > { "sWidth": "3%" }, >- { "sWidth": "11%" }, >- { "sWidth": "75%" }, >+ { >+ "sWidth": "11%", >+ "render": function(data, type, row, meta){ >+ return escape_str(data); >+ } >+ }, >+ { >+ "sWidth": "75%", >+ "render": function(data, type, row, meta){ >+ return escape_str(data); >+ } >+ }, > { "sWidth": "11%" }, > ], > "oLanguage": dataTablesDefaults.oLanguage, >-- >2.20.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 27942
:
118363
|
118867
|
119043
|
120429
|
120482
|
120726
|
120727