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:40:00 UTC

[jira] [Commented] (OFBIZ-13476) MultiTrustManager does not perform real X.509 chain validation, breaking outbound HTTPS to external servers.

    [ https://issues.apache.org/jira/browse/OFBIZ-13476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18102669#comment-18102669 ] 

ASF subversion and git services commented on OFBIZ-13476:
---------------------------------------------------------

Commit 460b031756875e6234b313f38744fa5ec02ee669 in ofbiz-framework's branch refs/heads/trunk from Mridul Pathak
[ https://gitbox.apache.org/repos/asf?p=ofbiz-framework.git;h=460b031756 ]

Fixed: MultiTrustManager doing flat cert-equality checks instead of real X.509 chain validation (OFBIZ-13476) (#1545)

MultiTrustManager.isTrusted() only accepted certificates that were byte-identical to one already stored in a configured trust KeyStore, instead of validating the certificate chain up to a trusted root. This rejected any real, externally-issued certificate (e.g. Google Trust Services certs used by the OAuth2 endpoints surfaced in OFBIZ-13474) even when the correct root CA was present and trusted. checkClientTrusted/checkServerTrusted now delegate to a standard TrustManagerFactory-backed X509TrustManager built from the same trust anchors, giving genuine PKIX path validation while preserving the existing client.all-trusted/server.all-trusted fallback behavior.

> MultiTrustManager does not perform real X.509 chain validation, breaking outbound HTTPS to external servers.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: OFBIZ-13476
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-13476
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: 24.09.07
>            Reporter: Mridul Pathak
>            Assignee: Mridul Pathak
>            Priority: Major
>
> {\{MultiTrustManager.isTrusted()}} (\{{framework/base/src/main/java/org/apache/ofbiz/base/util/MultiTrustManager.java}}, lines 130-149) trusts a certificate only if it is byte-equal to one already sitting in a configured KeyStore. It never validates the chain up to a trusted root, so any certificate signed by a trusted CA but not itself pre-stored verbatim -- essentially every real, rotating external certificate -- is rejected even though the correct root CA is present and trusted.
> Confirmed live: an HTTPS call to \{{oauth2.googleapis.com}} failed with "No trusted certificate found", while the JDK's own default trust manager accepted the exact same certificate chain using the exact same \{{cacerts}} truststore. Same applies to any custom root CA added via a component's \{{is-truststore="true"}} keystore -- installing the CA isn't enough, since only literal cert matches are trusted.
> Affects all outbound HTTPS via \{{HttpClient}}/\{{SSLUtil.getTrustManagers()}} -- webhooks, REST integrations, and the OAuth2 token-refresh flow in OFBIZ-13474.
> h3. Suggested fix
> Build an in-memory KeyStore from the same trust anchors \{{getAcceptedIssuers()}} already collects, initialize a standard \{{TrustManagerFactory}} with it, and delegate \{{checkClientTrusted}}/\{{checkServerTrusted}} to the resulting real \{{X509TrustManager}}.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)