This is an automated email from the ASF dual-hosted git repository.

mridulpathak pushed a commit to branch release24.09
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/release24.09 by this push:
     new 7a989fefe0 Fixed: isExecutable() mime-type comparisons never matched 
Tika's actual types (OFBIZ-13486)
7a989fefe0 is described below

commit 7a989fefe0bdf859413be162bc93c770d6801809
Author: Mridul Pathak <[email protected]>
AuthorDate: Fri Aug 7 16:06:16 2026 +0530

    Fixed: isExecutable() mime-type comparisons never matched Tika's actual 
types (OFBIZ-13486)
    
    SecuredUpload.isExecutable() compared Tika's detected mime type against 
"application/text/x-perl", "application/text/x-ruby", 
"application/text/x-python", but Tika (verified against this project's 
tika-core:3.3.1 dependency) actually registers these as "text/x-perl", 
"text/x-ruby", "text/x-python" with no "application/" prefix, so the 
comparisons have been dead code since introduction. Corrects the three strings 
to match Tika's actual output.
    
    Backported from trunk (#1583).
---
 .../src/main/java/org/apache/ofbiz/security/SecuredUpload.java      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java 
b/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java
index b3440ac061..41cf8e2d1f 100644
--- 
a/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java
+++ 
b/framework/security/src/main/java/org/apache/ofbiz/security/SecuredUpload.java
@@ -1112,9 +1112,9 @@ public class SecuredUpload {
         // Check for ELF (Linux) and scripts
         if ("application/x-elf".equals(mimeType)
                 || "application/x-sh".equals(mimeType)
-                || "application/text/x-perl".equals(mimeType)
-                || "application/text/x-ruby".equals(mimeType)
-                || "application/text/x-python".equals(mimeType)) {
+                || "text/x-perl".equals(mimeType)
+                || "text/x-ruby".equals(mimeType)
+                || "text/x-python".equals(mimeType)) {
             Debug.logError("The file " + fileName + " is a Linux executable, 
for security reason it's not accepted", MODULE);
             return true;
         }

Reply via email to