From b2b6250fac491d50c1e883bdb092a4df06bf9831 Mon Sep 17 00:00:00 2001 From: Jacques Le Roux Date: Fri, 4 Feb 2022 15:03:51 +0100 Subject: [PATCH] Fixed: Remote Code Execution (File Upload) Vulnerability (OFBIZ-11948) I forgot about SecurityUtilTest::webShellTokensTesting. This fixes it. Note that I expect to simplify and remove more tokens for PHP, but I have 1st other things to do... --- framework/security/config/security.properties | 3 ++- .../ofbiz/security/SecurityUtilTest.java | 22 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/framework/security/config/security.properties b/framework/security/config/security.properties index 9eccffb630..4bb27513f3 100644 --- a/framework/security/config/security.properties +++ b/framework/security/config/security.properties @@ -238,9 +238,10 @@ allowAllUploads= #-- eg: https://www.acunetix.com/blog/articles/detection-prevention-introduction-web-shells-part-5/ #-- "freemarker" should be OK, should not be used in Freemarker templates, not part of the syntax. #-- Else "template.utility.Execute" is a good replacement but not as much catching, who knows... -deniedWebShellTokens=<%,,,(); assertFalse(SecuredUpload.isValidText("hack.getFileName", allowed)); + + assertFalse(SecuredUpload.isValidText("<%", allowed)); + assertFalse(SecuredUpload.isValidText("", allowed)); - assertFalse(SecuredUpload.isValidText("", allowed)); + assertFalse(SecuredUpload.isValidText("