As explained in OFBIZ-6669 last comments, contrary to what I did in ContentWorker class, when I before did the work on *ContentWrapper classes I did not use the sanitizer but only an encoder (either HTML or URL). Because I wrongly supposed that only plain text was used there and certainly my lazy mind thought it was easier because of the URL encoderType to also handle. When the encoderType is HTML, we now use the sanitizer in *ContentWrapper classes, and ContentWorker.java has also been adapted. For that I enhanced the UtilCodec class. The sanitizer is only used when HTML is requested, else the sanitize() method simply calls the encode() method. I removed the content.sanitize property in content.properties and added a sanitizer.permissive.policy property in the new owasp.properties (in base config) with some explanations. This allows for more configuration. I changed the line 85 in productsummary.ftl to use an HTML content wrapper, same in minilastviewedcategories.ftl. To be totally complete, we should change *lines like* in productsummary.ftl line 85 to use an HTML content wrapper. Not easy to spot but anyway those not done will simply not totally show well, without any security impacts. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1713634 13f79535-47bb-0310-9956-ffa450edef68
29 lines
1.4 KiB
Properties
29 lines
1.4 KiB
Properties
###############################################################################
|
|
# Licensed to the Apache Software Foundation (ASF) under one
|
|
# or more contributor license agreements. See the NOTICE file
|
|
# distributed with this work for additional information
|
|
# regarding copyright ownership. The ASF licenses this file
|
|
# to you under the Apache License, Version 2.0 (the
|
|
# "License"); you may not use this file except in compliance
|
|
# with the License. You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing,
|
|
# software distributed under the License is distributed on an
|
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
# KIND, either express or implied. See the License for the
|
|
# specific language governing permissions and limitations
|
|
# under the License.
|
|
###############################################################################
|
|
|
|
####
|
|
# OFBiz OWASP properties File https://www.owasp.org/index.php/Main_Page
|
|
####
|
|
|
|
# Should we use a permissive sanitizer policy? False By default!
|
|
# This has a slightly impact on the code rendered, see last comments in OFBIZ-6669.
|
|
# Given as an example based on rendering cmssite, as it was before using the sanitizer.
|
|
# You might even want to adapt the PERMISSIVE_POLICY to your needs... Be sure to check https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet before...
|
|
sanitizer.permissive.policy=false
|