From eabcc96c5ff8d8c3b90fa6883bcc04411de2b537 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Thu, 27 Apr 2017 18:46:36 +0000 Subject: [PATCH] Fixed: Create and use an OWASP PolicyFactory for content sanitization in ContentWorker for Birt Flexible Reports (OFBIZ-9166) git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1792939 13f79535-47bb-0310-9956-ffa450edef68 --- .../ofbiz/content/content/ContentWorker.java | 24 ++++---- .../org/apache/ofbiz/base/util/UtilCodec.java | 60 +++++++------------ 2 files changed, 34 insertions(+), 50 deletions(-) diff --git a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java index d22dd00988..7a24575aec 100644 --- a/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java +++ b/applications/content/src/main/java/org/apache/ofbiz/content/content/ContentWorker.java @@ -338,19 +338,17 @@ public class ContentWorker implements org.apache.ofbiz.widget.content.ContentWor GenericValue content = EntityQuery.use(dispatcher.getDelegator()).from("Content").where("contentId", contentId).queryOne(); String contentTypeId = content.getString("contentTypeId"); String rendered = writer.toString(); - // According to https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#XSS_Prevention_Rules_Summary - // Normally head is protected by X-XSS-Protection Response Header by default - if (!"FLEXIBLE_REPORT".equals(contentTypeId)) { // FIXME here BIRT_REPORT_BUILDER_USAGE_POLICY should be used but I could not tweak it yet: the content of