From add8fd7eaf9536bfd82a5613a66bcf22a42b017b Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Fri, 24 May 2019 13:27:38 +0000 Subject: [PATCH] "Applied fix from trunk for revision: 1859871" ------------------------------------------------------------------------ r1859871 | jleroux | 2019-05-24 15:24:31 +0200 (ven. 24 mai 2019) | 14 lignes Fixed: OWASP sanitizer breaks proper rendering of HTML code (OFBIZ-10187) After a discussion with Dennis, I checked and the pattern ONSITE_URL would be useless without .allowAttributes("background").matching(ONSITE_URL) .onElements("table") .allowAttributes("background").matching(ONSITE_URL) .onElements("td", "th", "tr") So here they are Thanks: Dennis Balkir for discussion ------------------------------------------------------------------------ git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release17.12@1859873 13f79535-47bb-0310-9956-ffa450edef68 --- .../base/html/CustomPermissivePolicy.java | 8 +++-- .../smoothness/jquery-ui-1.8.13.custom.css | 34 +++++++++---------- .../plugins/jsTree/themes/apple/style.css | 6 ++-- .../plugins/jsTree/themes/classic/style.css | 6 ++-- .../jsTree/themes/default-rtl/style.css | 6 ++-- .../plugins/jsTree/themes/default/style.css | 6 ++-- 6 files changed, 35 insertions(+), 31 deletions(-) diff --git a/framework/base/src/main/java/org/apache/ofbiz/base/html/CustomPermissivePolicy.java b/framework/base/src/main/java/org/apache/ofbiz/base/html/CustomPermissivePolicy.java index 607cfddf9c..b67aad7153 100644 --- a/framework/base/src/main/java/org/apache/ofbiz/base/html/CustomPermissivePolicy.java +++ b/framework/base/src/main/java/org/apache/ofbiz/base/html/CustomPermissivePolicy.java @@ -17,7 +17,7 @@ import com.google.common.base.Predicate; * has been subject to a few complex XSS attacks. Listings are allowed to * contain much more rich content than, say, Slashdot- so it's attack surface is * considerably larger. The following tags appear to be accepted by eBay (they - * don't publish rules): {@code },... + * don't publish rules): {@code },... */ public class CustomPermissivePolicy implements SanitizerCustomPolicy { @@ -112,11 +112,15 @@ public class CustomPermissivePolicy implements SanitizerCustomPolicy { .matching(NUMBER).onElements("table") .allowAttributes("bgcolor").matching(COLOR_NAME_OR_COLOR_CODE) .onElements("table") + .allowAttributes("background").matching(ONSITE_URL) + .onElements("table") + .allowAttributes("background").matching(ONSITE_URL) + .onElements("td", "th", "tr") .allowAttributes("align").matching(ALIGN) .onElements("table") .allowAttributes("noresize").matching(Pattern.compile("(?i)noresize")) .onElements("table") - .allowAttributes("bgcolor").matching(COLOR_NAME_OR_COLOR_CODE) + .allowAttributes("bgcolor").matching(COLOR_NAME_OR_COLOR_CODE) .onElements("td", "th") .allowAttributes("abbr").matching(PARAGRAPH) .onElements("td", "th") diff --git a/themes/common/webapp/common/js/jquery/plugins/elrte-1.3/css/smoothness/jquery-ui-1.8.13.custom.css b/themes/common/webapp/common/js/jquery/plugins/elrte-1.3/css/smoothness/jquery-ui-1.8.13.custom.css index d3fb1c7601..b636769520 100644 --- a/themes/common/webapp/common/js/jquery/plugins/elrte-1.3/css/smoothness/jquery-ui-1.8.13.custom.css +++ b/themes/common/webapp/common/js/jquery/plugins/elrte-1.3/css/smoothness/jquery-ui-1.8.13.custom.css @@ -59,26 +59,26 @@ .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } .ui-widget .ui-widget { font-size: 1em; } .ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } +.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(/images/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } .ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } +.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(/images/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } .ui-widget-header a { color: #222222; } /* Interaction states ----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(/images/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(/images/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(/images/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } .ui-widget :active { outline: none; } /* Interaction Cues ----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(/images/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } .ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(/images/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } .ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } .ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } .ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } @@ -89,14 +89,14 @@ ----------------------------------*/ /* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); } +.ui-icon { width: 16px; height: 16px; background-image: url(/images/ui-icons_222222_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(/images/ui-icons_222222_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(/images/ui-icons_222222_256x240.png); } +.ui-state-default .ui-icon { background-image: url(/images/ui-icons_888888_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(/images/ui-icons_454545_256x240.png); } +.ui-state-active .ui-icon {background-image: url(/images/ui-icons_454545_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(/images/ui-icons_2e83ff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(/images/ui-icons_cd0a0a_256x240.png); } /* positioning */ .ui-icon-carat-1-n { background-position: 0 0; } @@ -291,8 +291,8 @@ .ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; } /* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* +.ui-widget-overlay { background: #aaaaaa url(/images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(/images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/* * jQuery UI Resizable 1.8.13 * * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) diff --git a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/apple/style.css b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/apple/style.css index 5be4e10cc4..dcbc81d92b 100644 --- a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/apple/style.css +++ b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/apple/style.css @@ -40,9 +40,9 @@ .jstree-apple .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } #vakata-dragged.jstree-apple ins { background:transparent !important; } -#vakata-dragged.jstree-apple .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } -#vakata-dragged.jstree-apple .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } -#jstree-marker.jstree-apple { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } +#vakata-dragged.jstree-apple .jstree-ok { background:url("/images/d.png") -2px -53px no-repeat !important; } +#vakata-dragged.jstree-apple .jstree-invalid { background:url("/images/d.png") -18px -53px no-repeat !important; } +#jstree-marker.jstree-apple { background:url("/images/d.png") -41px -57px no-repeat !important; text-indent:-100px; } .jstree-apple a.jstree-search { color:aqua; } .jstree-apple .jstree-locked a { color:silver; cursor:default; } diff --git a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/classic/style.css b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/classic/style.css index 681b2cf563..c8401ec255 100644 --- a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/classic/style.css +++ b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/classic/style.css @@ -39,9 +39,9 @@ .jstree-classic .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } #vakata-dragged.jstree-classic ins { background:transparent !important; } -#vakata-dragged.jstree-classic .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } -#vakata-dragged.jstree-classic .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } -#jstree-marker.jstree-classic { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } +#vakata-dragged.jstree-classic .jstree-ok { background:url("/images/d.png") -2px -53px no-repeat !important; } +#vakata-dragged.jstree-classic .jstree-invalid { background:url("/images/d.png") -18px -53px no-repeat !important; } +#jstree-marker.jstree-classic { background:url("/images/d.png") -41px -57px no-repeat !important; text-indent:-100px; } .jstree-classic a.jstree-search { color:aqua; } .jstree-classic .jstree-locked a { color:silver; cursor:default; } diff --git a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default-rtl/style.css b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default-rtl/style.css index 81e8d65c3d..b057277c7a 100644 --- a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default-rtl/style.css +++ b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default-rtl/style.css @@ -38,9 +38,9 @@ .jstree-default-rtl .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } #vakata-dragged.jstree-default-rtl ins { background:transparent !important; } -#vakata-dragged.jstree-default-rtl .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } -#vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } -#jstree-marker.jstree-default-rtl { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } +#vakata-dragged.jstree-default-rtl .jstree-ok { background:url("/images/d.png") -2px -53px no-repeat !important; } +#vakata-dragged.jstree-default-rtl .jstree-invalid { background:url("/images/d.png") -18px -53px no-repeat !important; } +#jstree-marker.jstree-default-rtl { background:url("/images/d.png") -41px -57px no-repeat !important; text-indent:-100px; } .jstree-default-rtl a.jstree-search { color:aqua; } .jstree-default-rtl .jstree-locked a { color:silver; cursor:default; } diff --git a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default/style.css b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default/style.css index a07fed74b3..2aad08d833 100644 --- a/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default/style.css +++ b/themes/common/webapp/common/js/jquery/plugins/jsTree/themes/default/style.css @@ -38,9 +38,9 @@ .jstree-default .jstree-undetermined > a > .jstree-checkbox:hover { background-position:-20px -37px; } #vakata-dragged.jstree-default ins { background:transparent !important; } -#vakata-dragged.jstree-default .jstree-ok { background:url("d.png") -2px -53px no-repeat !important; } -#vakata-dragged.jstree-default .jstree-invalid { background:url("d.png") -18px -53px no-repeat !important; } -#jstree-marker.jstree-default { background:url("d.png") -41px -57px no-repeat !important; text-indent:-100px; } +#vakata-dragged.jstree-default .jstree-ok { background:url("/images/d.png") -2px -53px no-repeat !important; } +#vakata-dragged.jstree-default .jstree-invalid { background:url("/images/d.png") -18px -53px no-repeat !important; } +#jstree-marker.jstree-default { background:url("/images/d.png") -41px -57px no-repeat !important; text-indent:-100px; } .jstree-default a.jstree-search { color:aqua; } .jstree-default .jstree-locked a { color:silver; cursor:default; }