You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ofbiz.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/08/07 05:16:00 UTC
[jira] [Commented] (OFBIZ-13485) PDF upload security check accepts embedded attachments when ZUGFeRD-compliant upload is disabled (logic inversion in canParseZUGFeRD)
[ https://issues.apache.org/jira/browse/OFBIZ-13485?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102658#comment-18102658 ]
ASF subversion and git services commented on OFBIZ-13485:
---------------------------------------------------------
Commit 55a3879895057c81841b6ef2eb29ed7ed72b6f51 in ofbiz-framework's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=55a3879895 ]
Fixed: PDF upload accepted embedded attachments when ZUGFeRD upload was disabled (OFBIZ-13485) (#1573)
Fixed: PDF upload accepted embedded attachments when ZUGFeRD upload was disabled (OFBIZ-13485)
canParseZUGFeRD was initialized to true and only ever reset to false inside the ZUGFeRD-compliant-upload branch. When allowZUGFeRDCompliantUpload=false, that branch never ran, so any PDF containing embedded files of any] type was reported safe regardless of content. Initializing canParseZUGFeRD to false restores fail-closed behavior for that path.
Also fixes a related regression: in the secure ZUGFeRD sub-mode (allowZUGFeRDnotSecure=false), canParseZUGFeRD was never set back to true on successful XML validation, so legitimate ZUGFeRD invoices were always rejected under the shipped defaults.
> PDF upload security check accepts embedded attachments when ZUGFeRD-compliant upload is disabled (logic inversion in canParseZUGFeRD)
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-13485
> URL: https://issues.apache.org/jira/browse/OFBIZ-13485
> Project: OFBiz
> Issue Type: Bug
> Components: framework/security
> Affects Versions: 24.09.07
> Reporter: Mridul Pathak
> Assignee: Mridul Pathak
> Priority: Critical
>
> {{SecuredUpload.isValidPdfFile()}} initializes {{canParseZUGFeRD = true}} and only ever resets it to {{false}} inside the ZUGFeRD-upload-enabled branch. When {{security.properties}} has {{allowZUGFeRDCompliantUpload=false}}, that branch never runs, so *any PDF with embedded files of any type is reported safe*, with zero inspection. Verified: a PDF with an embedded {{payload.exe}} was accepted.
> Introduced in {{c3653d51ae88e6a0069bb750d8d36c7fa0e4e1a7}} (OFBIZ-12926, 2024-03-12), which flipped a previously fail-closed initializer to fail-open. Reachable via the standard authenticated upload service ({{DataServices.isValidFile}}).
> h3. Fix
> Initialize {{canParseZUGFeRD = false}} at SecuredUpload.java line 1025.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)