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

Gabriel39 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new a8e46717f83 [deps](fe) Upgrade bundled Bouncy Castle to 1.87 (#71066)
a8e46717f83 is described below

commit a8e46717f832005b11d14bc83c2914fcdae8a435
Author: Gabriel <[email protected]>
AuthorDate: Mon Nov 30 21:43:47 2026 +0800

    [deps](fe) Upgrade bundled Bouncy Castle to 1.87 (#71066)
    
    ### Background
    
    Bouncy Castle supplies cryptographic and certificate APIs to Doris
    filesystem and lake connectors. FE and BE Java plugins have separate
    classloaders, and Paimon S3 embeds a component-only runtime. Maven
    version management does not replace classes already packed inside those
    dependency jars.
    
    ### What problem does this PR solve?
    
    Issue Number: None
    Related PR: #67000 (introduced the managed 1.84 pin), #68216 and #68352
    (earlier proposed 1.85 upgrades)
    PR Type: Release/Dependency
    
    Problem Summary:
    
    Master packages Bouncy Castle 1.84 alongside embedded 1.65 and 1.78.1
    copies, leaving upstream security fixes absent and unsigned older
    classes beside signed modules. Upgrade the managed modules to 1.87,
    replace the isolated Paimon S3 provider, and remove the old DLF copies
    from the two Hive shades. Keep replacements as signed jars where the
    loader supports them. Most added lines are regression tests for rejected
    inputs and valid cryptographic operations.
    
    ### Details
    
    - **Change map:** 200 added test lines; 78 added/26 removed build,
    dependency and license lines. The packaging changes handle managed
    version alignment, component-only Paimon S3 replacement, and DLF/Hive
    signer consistency. No production Java/C++ logic is changed.
    - **Versions:** Maven Central's bcprov/bcpkix/bcutil-jdk18on 1.84 to
    1.87; Paimon S3's embedded provider 1.78.1 to 1.87; DLF's embedded 1.65
    is replaced by managed signed modules. Preserve all non-BC Paimon
    runtime contents and update the bundled MIT license to the upstream
    text.
    - **Upstream changes:** Include the certificate-name constraint fixes in
    
[1.85](https://www.bouncycastle.org/resources/new-release-bouncy-castle-java-1-85/)
    and
    
[1.86](https://www.bouncycastle.org/resources/new-release-bouncy-castle-java-1-86/),
    including CVE-2026-8763 and CVE-2026-71889, plus [1.87's security
    
fixes](https://www.bouncycastle.org/resources/new-release-bouncy-castle-java-1-87/).
    Empty CMS signer sets must also fail signature verification.
    - **Compatibility:** Checked locally on Linux x86_64/JDK 17. Normal
    RSA/CMS signatures, SM3/HMAC, PEM parsing and MaxCompute TLS remain
    covered. Paimon's component-only provider stays at its existing nested
    prefix. Its Hive closure also needs PKIX/PEM APIs used by Nimbus/Netty,
    so replacing it with a provider alone would be incomplete. The license
    remains MIT.
    - **Rollback:** Revert the dependency and packaging change together; no
    Doris persistent format or configuration migration is introduced.
    Returning to the old dependencies reintroduces the upstream
    vulnerabilities.
    
    ### Testing
    
    - Baseline Paimon regression: 7 tests, 2 expected assertion failures, no
    errors/skips. Separate real-API probes reproduce the normal-library and
    leaf-certificate constraint defects.
    - Local run-fe-ut.sh preset: all 98 selected cases passed, with no
    failures/errors/skips, including both new regression classes, Paimon
    S3/plugin/HMS/DLF, OBS and MaxCompute TLS tests.
    - Fresh FE build and Checkstyle passed. Recursive inspection of 3,397
    built JAR paths found only BC 1.87; no BC remains inside either Hive
    shade. The nested provider matches official bytes and 40,101 common
    non-BC Paimon files are unchanged.
    - Actual FE/BE Java plugin runtimes passed all 179 assertions, including
    nested Paimon loading, certificate/CMS rejection, DLF SM3/HMAC and
    Nimbus PEM parsing. Normal signed modules use identical signing
    certificates.
    
    ### Notes for Reviewers
    
    Deploy refreshed FE plugins and BE Java plugin closures together. Verify
    the exact rebuilt release images separately; no commercial License
    startup, MS image scan, live-cloud service or deployed SQL regression
    was run locally. The dependency findings do not establish an exploitable
    Doris endpoint.
    
    ### Release note
    
    Upgrade Bouncy Castle to 1.87, including embedded Paimon/DLF dependency
    handling, to include upstream security fixes while preserving valid
    cryptographic operations.
    
    ### Check List (For Author)
    
    - Behavior changed: No
    - Does this need documentation: No
    - Pre-submission status: Ready
    
    ### AI Disclosure
    
    - Tool: Codex (GPT-6)
    - Generated: Dependency changes, tests, verification and this
    description
    - Human review: not stated
    - Prompts: Fix the dependency issue on master, verify the fix before
    committing, and complete local review before submission.
---
 dist/licenses/LICENSE.bouncycastle.txt             |  24 +++--
 .../doris/maxcompute/BouncyCastleSecurityTest.java | 120 +++++++++++++++++++++
 fe/be-java-extensions/paimon-s3-shade/pom.xml      |  31 ++++--
 fe/be-java-extensions/paimon-scanner/pom.xml       |   8 +-
 .../doris/paimon/PaimonBouncyCastleTest.java       |  80 ++++++++++++++
 .../fe-connector-hms-hive-shade/pom.xml            |   8 ++
 .../fe-connector-paimon-hive-shade/pom.xml         |  10 ++
 fe/fe-filesystem/fe-filesystem-obs/pom.xml         |   4 +-
 fe/pom.xml                                         |  19 +++-
 9 files changed, 278 insertions(+), 26 deletions(-)

diff --git a/dist/licenses/LICENSE.bouncycastle.txt 
b/dist/licenses/LICENSE.bouncycastle.txt
index e10bf1fa1c6..1f0172c5b42 100644
--- a/dist/licenses/LICENSE.bouncycastle.txt
+++ b/dist/licenses/LICENSE.bouncycastle.txt
@@ -1,9 +1,15 @@
-License
-
-Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle 
(http://www.bouncycastle.org)
-
-Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and associated documentation files (the "Software"), to deal 
in the Software without restriction, including without limitation the rights to 
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
of the Software, and to permit persons to whom the Software is furnished to do 
so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all 
copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.
+MIT License (https://opensource.org/licenses/MIT)
+
+Copyright (c) 2000-2026 The Legion of the Bouncy Castle Inc. 
(https://www.bouncycastle.org).
+Permission is hereby granted, free of charge, to any person obtaining a copy 
of this software and
+associated documentation files (the "Software"), to deal in the Software 
without restriction,
+including without limitation the rights to use, copy, modify, merge, publish, 
distribute,
+sub license, and/or sell copies of the Software, and to permit persons to whom 
the Software is
+furnished to do so, subject to the following conditions: The above copyright 
notice and this
+permission notice shall be included in all copies or substantial portions of 
the Software.
+
+**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
IMPLIED, INCLUDING BUT
+NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 
PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE 
FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
OTHERWISE, ARISING FROM, OUT
+OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 
SOFTWARE.**
diff --git 
a/fe/be-java-extensions/max-compute-connector/src/test/java/org/apache/doris/maxcompute/BouncyCastleSecurityTest.java
 
b/fe/be-java-extensions/max-compute-connector/src/test/java/org/apache/doris/maxcompute/BouncyCastleSecurityTest.java
new file mode 100644
index 00000000000..f72d5d31e06
--- /dev/null
+++ 
b/fe/be-java-extensions/max-compute-connector/src/test/java/org/apache/doris/maxcompute/BouncyCastleSecurityTest.java
@@ -0,0 +1,120 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.maxcompute;
+
+import org.bouncycastle.asn1.DEROctetString;
+import org.bouncycastle.asn1.DERSet;
+import org.bouncycastle.asn1.cms.CMSObjectIdentifiers;
+import org.bouncycastle.asn1.cms.ContentInfo;
+import org.bouncycastle.asn1.cms.SignedData;
+import org.bouncycastle.asn1.x509.GeneralName;
+import org.bouncycastle.asn1.x509.GeneralSubtree;
+import org.bouncycastle.cms.CMSException;
+import org.bouncycastle.cms.CMSProcessableByteArray;
+import org.bouncycastle.cms.CMSSignedData;
+import org.bouncycastle.cms.CMSSignedDataGenerator;
+import org.bouncycastle.cms.jcajce.JcaSignerInfoGeneratorBuilder;
+import org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+import org.bouncycastle.jce.provider.PKIXNameConstraintValidator;
+import org.bouncycastle.jce.provider.PKIXNameConstraintValidatorException;
+import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
+import org.bouncycastle.operator.jcajce.JcaDigestCalculatorProviderBuilder;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import java.nio.charset.StandardCharsets;
+import java.security.KeyPair;
+import java.security.KeyPairGenerator;
+import java.security.Provider;
+import java.security.Signature;
+
+class BouncyCastleSecurityTest {
+    @ParameterizedTest
+    @CsvSource({
+            "1,[email protected].,true",
+            "6,https://example.com./,true";,
+            "1,[email protected],true",
+            "6,https://example.com/,true";,
+            "1,[email protected],false",
+            "6,https://safe.example/,false";
+    })
+    void enforcesExcludedHostsWithAndWithoutTrailingDots(int tag, String 
candidate, boolean excluded) {
+        PKIXNameConstraintValidator validator = new 
PKIXNameConstraintValidator();
+        validator.addExcludedSubtree(new GeneralSubtree(new GeneralName(tag, 
"example.com")));
+        GeneralName name = new GeneralName(tag, candidate);
+        // A DNS root-label dot must not let an excluded certificate identity 
escape its constraint.
+        if (excluded) {
+            
Assertions.assertThrows(PKIXNameConstraintValidatorException.class, () -> 
validator.checkExcluded(name));
+        } else {
+            Assertions.assertDoesNotThrow(() -> validator.checkExcluded(name));
+        }
+    }
+
+    @Test
+    void rejectsCmsWithNoSigners() throws Exception {
+        SignedData unsigned = new SignedData(new DERSet(),
+                new ContentInfo(CMSObjectIdentifiers.data, new 
DEROctetString(new byte[] {1, 2, 3})),
+                null, null, new DERSet());
+        CMSSignedData data = new CMSSignedData(new 
ContentInfo(CMSObjectIdentifiers.signedData, unsigned));
+        // An empty signer set must not turn signature verification into a 
vacuous success.
+        Assertions.assertThrows(CMSException.class, () -> 
data.verifySignatures(id -> {
+            throw new AssertionError("An unsigned message has no signer to 
resolve");
+        }));
+    }
+
+    @Test
+    void verifiesSignedCmsAndRejectsTamperedContent() throws Exception {
+        KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
+        generator.initialize(2048);
+        KeyPair keys = generator.generateKeyPair();
+        CMSSignedDataGenerator generatorCms = new CMSSignedDataGenerator();
+        generatorCms.addSignerInfoGenerator(new JcaSignerInfoGeneratorBuilder(
+                new JcaDigestCalculatorProviderBuilder().build()).build(
+                    new 
JcaContentSignerBuilder("SHA256withRSA").build(keys.getPrivate()), new byte[] 
{1, 2, 3}));
+        CMSSignedData signed = generatorCms.generate(new 
CMSProcessableByteArray(new byte[] {4, 5, 6}), false);
+        CMSSignedData valid = new CMSSignedData(new 
CMSProcessableByteArray(new byte[] {4, 5, 6}), signed.getEncoded());
+        Assertions.assertTrue(valid.verifySignatures(
+                id -> new 
JcaSimpleSignerInfoVerifierBuilder().build(keys.getPublic())));
+        CMSSignedData tampered = new CMSSignedData(
+                new CMSProcessableByteArray(new byte[] {4, 5, 7}), 
signed.getEncoded());
+        Assertions.assertThrows(CMSException.class, () -> 
tampered.verifySignatures(
+                id -> new 
JcaSimpleSignerInfoVerifierBuilder().build(keys.getPublic())));
+    }
+
+    @Test
+    void initializesProviderAndPreservesRsaSignatureVerification() throws 
Exception {
+        Provider provider = new BouncyCastleProvider();
+        KeyPairGenerator generator = KeyPairGenerator.getInstance("RSA");
+        generator.initialize(2048);
+        KeyPair keys = generator.generateKeyPair();
+        Signature signature = Signature.getInstance("SHA256withRSA", provider);
+        byte[] message = 
"fixture-signed-content".getBytes(StandardCharsets.UTF_8);
+        signature.initSign(keys.getPrivate());
+        signature.update(message);
+        byte[] signed = signature.sign();
+        signature.initVerify(keys.getPublic());
+        signature.update(message);
+        Assertions.assertTrue(signature.verify(signed));
+        signature.initVerify(keys.getPublic());
+        
signature.update("fixture-tampered-content".getBytes(StandardCharsets.UTF_8));
+        Assertions.assertFalse(signature.verify(signed));
+    }
+}
diff --git a/fe/be-java-extensions/paimon-s3-shade/pom.xml 
b/fe/be-java-extensions/paimon-s3-shade/pom.xml
index 427e4f66b3a..eea43d3ba32 100644
--- a/fe/be-java-extensions/paimon-s3-shade/pom.xml
+++ b/fe/be-java-extensions/paimon-s3-shade/pom.xml
@@ -31,8 +31,8 @@ under the License.
     <packaging>jar</packaging>
     <name>Doris BE Java Extensions - Paimon S3 Shade</name>
     <description>
-        Repackages Paimon's self-contained S3 FileIO plugin without the outer 
multi-release
-        entries that leak out of its embedded plugin runtime.
+        Repackages Paimon's self-contained S3 FileIO plugin with the managed 
Bouncy Castle provider
+        and without the outer multi-release entries that leak out of its 
embedded plugin runtime.
     </description>
 
     <dependencies>
@@ -41,8 +41,8 @@ under the License.
           paimon-plugin-s3/. Its build also copies that runtime's 
META-INF/versions tree to the
           OUTER jar. Those outer entries include an older Bouncy Castle 
overlay and therefore
           override parts of hadoop-common's bcprov-jdk18on when both jars 
share the scanner
-          classloader. Keep the embedded runtime byte-for-byte, but remove the 
accidental outer
-          overlay. Optional plus wildcard exclusions ensure consumers get only 
this corrected jar,
+          classloader. Remove the accidental outer overlay and replace the 
embedded provider below.
+          Optional plus wildcard exclusions ensure consumers get only this 
corrected jar,
           never the source artifact or another transitive copy.
         -->
         <dependency>
@@ -56,6 +56,13 @@ under the License.
                 </exclusion>
             </exclusions>
         </dependency>
+        <!-- Paimon's component-only loader cannot use the provider on the 
scanner classpath.
+             Replace its complete embedded BC tree, including multi-release 
classes, at the same prefix. -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk18on</artifactId>
+            <optional>true</optional>
+        </dependency>
     </dependencies>
 
     <profiles>
@@ -122,9 +129,19 @@ under the License.
                                     <version>${paimon.version}</version>
                                     <overWrite>true</overWrite>
                                     
<outputDirectory>${project.build.outputDirectory}</outputDirectory>
-                                    <!-- This matches only the outer overlay. 
The embedded
-                                         paimon-plugin-s3/META-INF/versions/** 
tree is preserved. -->
-                                    
<excludes>META-INF/maven/**,META-INF/versions/**</excludes>
+                                    <!-- Remove old BC classes before 
unpacking their replacement, so retired
+                                         classes cannot survive alongside the 
new provider. Keep non-BC contents. -->
+                                    
<excludes>META-INF/maven/**,META-INF/versions/**,paimon-plugin-s3/org/bouncycastle/**,paimon-plugin-s3/META-INF/versions/**/org/bouncycastle/**</excludes>
+                                </artifactItem>
+                                <artifactItem>
+                                    <groupId>org.bouncycastle</groupId>
+                                    <artifactId>bcprov-jdk18on</artifactId>
+                                    
<version>${bcprov-jdk18on.version}</version>
+                                    <overWrite>true</overWrite>
+                                    
<outputDirectory>${project.build.outputDirectory}/paimon-plugin-s3</outputDirectory>
+                                    <!-- The upstream embedded runtime is 
unsigned. Do not copy a signed jar's
+                                         manifest/signatures into it or 
overwrite unrelated service registrations. -->
+                                    
<includes>org/bouncycastle/**,META-INF/versions/**/org/bouncycastle/**,META-INF/LICENSE.md</includes>
                                 </artifactItem>
                             </artifactItems>
                         </configuration>
diff --git a/fe/be-java-extensions/paimon-scanner/pom.xml 
b/fe/be-java-extensions/paimon-scanner/pom.xml
index d238b253442..2c94b7a97c9 100644
--- a/fe/be-java-extensions/paimon-scanner/pom.xml
+++ b/fe/be-java-extensions/paimon-scanner/pom.xml
@@ -125,10 +125,10 @@ under the License.
           constraint - these two lived on the shared preload classpath while 
the interface did not,
           which is a NoClassDefFoundError - and it is now simply what a plugin 
directory is.
 
-          paimon-s3-shade is Paimon's self-contained fat jar with only the 
accidental OUTER
-          multi-release overlay removed. The actual embedded runtime under 
paimon-plugin-s3/ is
-          unchanged; see that module for why deploying the upstream jar beside 
Hadoop's current
-          Bouncy Castle dependency is unsafe. paimon-jindo is 24KB of adapter: 
the
+          paimon-s3-shade removes the accidental OUTER multi-release overlay 
and replaces the
+          embedded Bouncy Castle provider with the managed version. The other 
runtime contents under
+          paimon-plugin-s3/ stay unchanged; see that module for the isolation 
requirement.
+          paimon-jindo is 24KB of adapter: the
           implementation it names, com.aliyun.jindodata.*, ships in the 
JindoFS jars, which are not
           maven artifacts - build.sh copies them into this plugin directory 
after post-build.sh has
           packaged them (a no-op unless the build asked for jindofs, i.e. 
DISABLE_BUILD_JINDOFS=OFF,
diff --git 
a/fe/be-java-extensions/paimon-scanner/src/test/java/org/apache/doris/paimon/PaimonBouncyCastleTest.java
 
b/fe/be-java-extensions/paimon-scanner/src/test/java/org/apache/doris/paimon/PaimonBouncyCastleTest.java
new file mode 100644
index 00000000000..d614261d286
--- /dev/null
+++ 
b/fe/be-java-extensions/paimon-scanner/src/test/java/org/apache/doris/paimon/PaimonBouncyCastleTest.java
@@ -0,0 +1,80 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.apache.doris.paimon;
+
+import org.apache.paimon.plugin.PluginLoader;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.CsvSource;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.math.BigInteger;
+import java.net.URLClassLoader;
+import java.nio.charset.StandardCharsets;
+import java.security.MessageDigest;
+import java.security.Provider;
+
+class PaimonBouncyCastleTest {
+    @ParameterizedTest
+    @CsvSource({
+            "1,[email protected].,true",
+            "6,https://example.com./,true";,
+            "1,[email protected],true",
+            "6,https://example.com/,true";,
+            "1,[email protected],false",
+            "6,https://safe.example/,false";
+    })
+    void embeddedProviderEnforcesExcludedHosts(int tag, String candidate, 
boolean excluded) throws Exception {
+        // Paimon's component-only loader cannot inherit a fixed provider from 
the scanner classpath.
+        try (URLClassLoader loader = (URLClassLoader) new 
PluginLoader("paimon-plugin-s3").submoduleClassLoader()) {
+            Class<?> nameType = 
loader.loadClass("org.bouncycastle.asn1.x509.GeneralName");
+            Class<?> subtreeType = 
loader.loadClass("org.bouncycastle.asn1.x509.GeneralSubtree");
+            Class<?> validatorType = 
loader.loadClass("org.bouncycastle.jce.provider.PKIXNameConstraintValidator");
+            Object validator = validatorType.getConstructor().newInstance();
+            Object constraint = nameType.getConstructor(int.class, 
String.class).newInstance(tag, "example.com");
+            Object subtree = 
subtreeType.getConstructor(nameType).newInstance(constraint);
+            validatorType.getMethod("addExcludedSubtree", 
subtreeType).invoke(validator, subtree);
+            Object name = nameType.getConstructor(int.class, 
String.class).newInstance(tag, candidate);
+            Method check = validatorType.getMethod("checkExcluded", nameType);
+            if (excluded) {
+                InvocationTargetException failure = Assertions.assertThrows(
+                        InvocationTargetException.class, () -> 
check.invoke(validator, name));
+                
Assertions.assertEquals("org.bouncycastle.jce.provider.PKIXNameConstraintValidatorException",
+                        failure.getCause().getClass().getName());
+            } else {
+                Assertions.assertDoesNotThrow(() -> check.invoke(validator, 
name));
+            }
+        }
+    }
+
+    @Test
+    void embeddedProviderRemainsIsolatedAndComputesSm3() throws Exception {
+        try (URLClassLoader loader = (URLClassLoader) new 
PluginLoader("paimon-plugin-s3").submoduleClassLoader()) {
+            Class<?> providerType = 
loader.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider");
+            Assertions.assertSame(loader, providerType.getClassLoader());
+            Assertions.assertNotSame(getClass().getClassLoader(), 
providerType.getClassLoader());
+            Provider provider = (Provider) 
providerType.getConstructor().newInstance();
+            byte[] digest = MessageDigest.getInstance("SM3", provider)
+                    .digest("abc".getBytes(StandardCharsets.US_ASCII));
+            
Assertions.assertEquals("66c7f0f462eeedd9d1f2d46bdc10e4e24167c4875cf2f7a2297da02b8f4ba8e0",
+                    new BigInteger(1, digest).toString(16));
+        }
+    }
+}
diff --git a/fe/fe-connector/fe-connector-hms-hive-shade/pom.xml 
b/fe/fe-connector/fe-connector-hms-hive-shade/pom.xml
index 25987bbc412..f91ef02cfe4 100644
--- a/fe/fe-connector/fe-connector-hms-hive-shade/pom.xml
+++ b/fe/fe-connector/fe-connector-hms-hive-shade/pom.xml
@@ -63,6 +63,11 @@ under the License.
     </description>
 
     <dependencies>
+        <!-- DLF's embedded provider is filtered below; keep its SM3 
implementation in a signed jar. -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk18on</artifactId>
+        </dependency>
         <!-- DLF's Hive-3 client must be shaded with the same thrift namespace 
as the Hive metastore
              classes below. Keeping that invariant lets Iceberg load 
ProxyMetaStoreClient entirely
              from its plugin instead of falling back to the removed host-side 
fat shade. -->
@@ -406,6 +411,9 @@ under the License.
                                         <exclude>META-INF/*.RSA</exclude>
                                         <exclude>META-INF/maven/**</exclude>
                                         <exclude>META-INF/versions/**</exclude>
+                                        <!-- The DLF fat jar embeds an 
unsigned BC 1.65 copy that Maven
+                                             version management cannot replace 
and that can split signed packages. -->
+                                        <exclude>org/bouncycastle/**</exclude>
                                     </excludes>
                                 </filter>
                             </filters>
diff --git a/fe/fe-connector/fe-connector-paimon-hive-shade/pom.xml 
b/fe/fe-connector/fe-connector-paimon-hive-shade/pom.xml
index c1d8736f53c..5394a5796de 100644
--- a/fe/fe-connector/fe-connector-paimon-hive-shade/pom.xml
+++ b/fe/fe-connector/fe-connector-paimon-hive-shade/pom.xml
@@ -51,6 +51,12 @@ under the License.
     </description>
 
     <dependencies>
+        <!-- Replace DLF's embedded BC with signed modules. The bundled 
Nimbus/Netty callers also
+             use PKIX/PEM APIs, so a standalone provider alone would leave 
those paths unresolved. -->
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcpkix-jdk18on</artifactId>
+        </dependency>
         <!-- Paimon uses Hive 2.3.x, so bundle the matching DLF client into 
this same private shade.
              Its thrift references are relocated together with Paimon's Hive 
client below. -->
         <dependency>
@@ -315,6 +321,8 @@ under the License.
                                  hive-catalog-shade. -->
                             <artifactSet>
                                 <excludes>
+                                    <!-- A provider must not be merged with 
DLF's old unsigned classes. -->
+                                    <exclude>org.bouncycastle:*</exclude>
                                     <exclude>org.apache.hadoop:*</exclude>
                                     
<exclude>org.apache.paimon:paimon-core</exclude>
                                     
<exclude>org.apache.paimon:paimon-common</exclude>
@@ -349,6 +357,8 @@ under the License.
                                         <exclude>META-INF/*.DSA</exclude>
                                         <exclude>META-INF/*.RSA</exclude>
                                         <exclude>META-INF/maven/**</exclude>
+                                        <!-- dependencyManagement cannot 
replace BC classes embedded in DLF. -->
+                                        <exclude>org/bouncycastle/**</exclude>
                                         <!-- The repo's 
paimon-hive-connector-3.1 is a fat bundle that
                                              carries multi-release variants 
compiled up to Java 22 (class
                                              major 65/66) under 
META-INF/versions/{17,21,22}/ (shaded
diff --git a/fe/fe-filesystem/fe-filesystem-obs/pom.xml 
b/fe/fe-filesystem/fe-filesystem-obs/pom.xml
index 650d7c439b7..1d0c6982350 100644
--- a/fe/fe-filesystem/fe-filesystem-obs/pom.xml
+++ b/fe/fe-filesystem/fe-filesystem-obs/pom.xml
@@ -70,8 +70,8 @@ under the License.
                 </exclusion>
             </exclusions>
         </dependency>
-        <!-- Replace Huawei IAM's bcprov-jdk15on 1.69/1.70 with 1.84 from the 
maintained
-             jdk18on line; it fixes CVE-2023-33202 and the later 2025/2026 BC 
Java advisories. -->
+        <!-- Replace Huawei IAM's retired jdk15on provider with the maintained 
jdk18on version
+             managed by the parent, rather than reintroducing an independently 
pinned copy. -->
         <dependency>
             <groupId>org.bouncycastle</groupId>
             <artifactId>bcprov-jdk18on</artifactId>
diff --git a/fe/pom.xml b/fe/pom.xml
index fc4225ffbc5..4652ead02ed 100644
--- a/fe/pom.xml
+++ b/fe/pom.xml
@@ -421,10 +421,10 @@ under the License.
         <ranger-plugins-common.version>2.9.0</ranger-plugins-common.version>
         <!-- Matches the jersey-core the FE already carries; only the Ranger 
plugins ask for it. -->
         <jersey.version>1.19.4</jersey.version>
-        <!-- Huawei IAM pulls bcprov-jdk15on 1.69, whose final 1.70 release is 
vulnerable to
-             CVE-2023-33202. Use the compatible jdk18on line at 1.84, which 
also fixes
-             CVE-2025-14813, CVE-2026-0636, CVE-2026-3505, CVE-2026-5588, and 
CVE-2026-5598. -->
-        <bcprov-jdk18on.version>1.84</bcprov-jdk18on.version>
+        <!-- Keep the provider and MaxCompute's PKIX modules on the same 
maintained release.
+             1.87 includes the 1.85/1.86 certificate, signature and parser 
security fixes;
+             replacing the retired jdk15on artifact alone does not cover those 
advisories. -->
+        <bcprov-jdk18on.version>1.87</bcprov-jdk18on.version>
         <woodstox.version>6.5.1</woodstox.version>
         <kerby.version>2.0.3</kerby.version>
         <jettison.version>1.5.4</jettison.version>
@@ -858,6 +858,17 @@ under the License.
                 <artifactId>bcprov-jdk18on</artifactId>
                 <version>${bcprov-jdk18on.version}</version>
             </dependency>
+            <!-- PKIX/PEM consumers must not mix a new provider with older 
signed utility modules. -->
+            <dependency>
+                <groupId>org.bouncycastle</groupId>
+                <artifactId>bcpkix-jdk18on</artifactId>
+                <version>${bcprov-jdk18on.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.bouncycastle</groupId>
+                <artifactId>bcutil-jdk18on</artifactId>
+                <version>${bcprov-jdk18on.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.springframework.boot</groupId>
                 <artifactId>spring-boot-dependencies</artifactId>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to