Skip to content

Commit 915a68b

Browse files
committed
chore: close another bunch of security issues (#612)
* chore: pom.xml: update helix-core to 1.3.0 close CVE-2023-38647 Refs: IN-790 * chore: pom.xml: update json to 20231013 close CVE-2023-5072 Refs: IN-790 * chore: pom.xml: update json to 20240303 Refs: IN-790 * chore: pom.xml: update antisamy to 1.7.6 (close CVE-2024-23635 Refs: IN-790 * chore: pom.xml: update xercesImpl to 2.12.2 (close CVE-2022-23437) Refs: IN-790 * chore: pom.xml: update jdom2 to 2.0.6.1 close CVE-2021-33813 Refs: IN-790 * chore: pom.xml: update commons-fileupload to 1.5 close CVE-2023-24998 Refs: IN-790 * chore: pom.xml: update guava to 33.3.1 close CVE-2023-2976 Refs: IN-790 * chore: general cleanup of dead or deprecate code
1 parent 0c59766 commit 915a68b

28 files changed

+1073
-993
lines changed

carbonio-jetty-libs/pom.xml

+4-4
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@
414414
<dependency>
415415
<groupId>org.apache.helix</groupId>
416416
<artifactId>helix-core</artifactId>
417-
<version>0.6.1-incubating</version>
417+
<version>1.3.0</version>
418418
<exclusions>
419419
<exclusion>
420420
<groupId>com.noelios.restlet</groupId>
@@ -584,8 +584,8 @@
584584
</dependency>
585585
<dependency>
586586
<groupId>org.jdom</groupId>
587-
<artifactId>jdom</artifactId>
588-
<version>1.1.3</version>
587+
<artifactId>jdom2</artifactId>
588+
<version>2.0.6.1</version>
589589
</dependency>
590590
<dependency>
591591
<groupId>org.jfree</groupId>
@@ -680,4 +680,4 @@
680680
</plugin>
681681
</plugins>
682682
</build>
683-
</project>
683+
</project>

client/pom.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
<plugin>
101101
<groupId>org.apache.maven.plugins</groupId>
102102
<artifactId>maven-source-plugin</artifactId>
103+
<version>3.3.1</version>
103104
<executions>
104105
<execution>
105106
<id>attach-sources</id>
@@ -113,4 +114,4 @@
113114
</plugins>
114115
</build>
115116

116-
</project>
117+
</project>

common/pom.xml

+1
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@
246246
<plugin>
247247
<groupId>org.apache.maven.plugins</groupId>
248248
<artifactId>maven-source-plugin</artifactId>
249+
<version>3.3.1</version>
249250
<executions>
250251
<execution>
251252
<id>attach-sources</id>

common/src/main/java/com/zimbra/common/net/CustomHostnameVerifier.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,19 @@
2424
import com.google.common.collect.Sets;
2525
import com.zimbra.common.util.ZimbraLog;
2626

27-
2827
public class CustomHostnameVerifier implements HostnameVerifier {
2928

30-
3129
public static void verifyHostname(String hostname, SSLSession session) throws IOException {
32-
if (NetConfig.getInstance().isAllowMismatchedCerts()) return;
30+
if (NetConfig.getInstance().isAllowMismatchedCerts())
31+
return;
3332

3433
try {
3534
InetAddress.getByName(hostname);
3635
} catch (UnknownHostException uhe) {
3736
throw new UnknownHostException("Could not resolve SSL sessions server hostname: " + hostname);
3837
}
3938

40-
javax.security.cert.X509Certificate[] certs = session.getPeerCertificateChain();
39+
java.security.cert.Certificate[] certs = session.getPeerCertificates();
4140
if (certs == null || certs.length == 0)
4241
throw new SSLPeerUnverifiedException("No server certificates found: " + hostname);
4342

@@ -52,14 +51,14 @@ public static void verifyHostname(String hostname, SSLSession session) throws IO
5251

5352
}
5453

55-
private static java.security.cert.X509Certificate certJavax2Java(javax.security.cert.X509Certificate cert) {
54+
private static java.security.cert.X509Certificate certJavax2Java(java.security.cert.Certificate cert) {
5655
try {
5756
ByteArrayInputStream bis = new ByteArrayInputStream(cert.getEncoded());
5857
CertificateFactory cf = CertificateFactory.getInstance("X.509");
5958
return (java.security.cert.X509Certificate) cf.generateCertificate(bis);
60-
} catch (CertificateException | CertificateEncodingException e) {
59+
} catch (CertificateException e) {
6160
}
62-
return null;
61+
return null;
6362
}
6463

6564
@Override
@@ -68,7 +67,7 @@ public boolean verify(String hostname, SSLSession session) {
6867
verifyHostname(hostname, session);
6968
} catch (IOException e) {
7069
ZimbraLog.security.debug(
71-
"Hostname verification failed: hostname = " + hostname, e);
70+
"Hostname verification failed: hostname = " + hostname, e);
7271
return false;
7372
}
7473
return true;

common/src/main/java/com/zimbra/common/net/SSLCertInfo.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public SSLCertInfo(String alias, String hostname, X509Certificate cert, boolean
6868

6969
serialNumber = cert.getSerialNumber().toString(16).toUpperCase();
7070

71-
String issuerDn = cert.getIssuerDN().getName();
71+
String issuerDn = cert.getIssuerX500Principal().getName();
7272
issuerCommonName = getComponent(issuerDn, COMMON_NAME);
7373
issuerOrganizationUnit = getComponent(issuerDn, ORGANIZATION_UNIT);
7474
issuerOrganization = getComponent(issuerDn, ORGANIZATION);

common/src/test/java/com/zimbra/common/util/BEncodingTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ public class BEncodingTest {
2525
@Test
2626
void test() throws Exception {
2727
List<Object> list = new ArrayList<Object>();
28-
list.add(new Integer(654));
28+
list.add(Integer.valueOf(654));
2929
list.add("hwhergk");
3030
list.add(new StringBuilder("74x"));
3131

3232
Map<String, Object> map = new HashMap<String, Object>();
33-
map.put("testing", new Long(5));
33+
map.put("testing", Long.valueOf(5));
3434
map.put("foo2", "bar");
3535
map.put("herp", list);
36-
map.put("Foo", new Float(6.7));
36+
map.put("Foo", Float.valueOf((float) 6.7));
3737
map.put("yy", new TreeMap<Object, Object>());
3838

3939
String encoded = BEncoding.encode(map);

native/pom.xml

+3-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<configuration>
4949
<target>
5050
<ant antfile="${basedir}/ant-native.xml">
51-
<target name="generate-native-headers"/>
51+
<target name="generate-native-headers" />
5252
</ant>
5353
</target>
5454
</configuration>
@@ -67,6 +67,7 @@
6767
<plugin>
6868
<groupId>org.apache.maven.plugins</groupId>
6969
<artifactId>maven-source-plugin</artifactId>
70+
<version>3.3.1</version>
7071
<executions>
7172
<execution>
7273
<id>attach-sources</id>
@@ -81,4 +82,4 @@
8182
</build>
8283

8384

84-
</project>
85+
</project>

pom.xml

+25-21
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
<dependency>
157157
<groupId>commons-fileupload</groupId>
158158
<artifactId>commons-fileupload</artifactId>
159-
<version>1.4</version>
159+
<version>1.5</version>
160160
</dependency>
161161
<dependency>
162162
<groupId>com.zextras.carbonio.files</groupId>
@@ -191,7 +191,7 @@
191191
<dependency>
192192
<groupId>org.apache.commons</groupId>
193193
<artifactId>commons-compress</artifactId>
194-
<version>1.20</version>
194+
<version>1.21</version>
195195
</dependency>
196196
<dependency>
197197
<groupId>ant-1.7.0-ziputil-patched</groupId>
@@ -261,7 +261,7 @@
261261
<dependency>
262262
<groupId>xerces</groupId>
263263
<artifactId>xercesImpl</artifactId>
264-
<version>2.12.0</version>
264+
<version>2.12.2</version>
265265
</dependency>
266266
<dependency>
267267
<groupId>javax.mail</groupId>
@@ -340,7 +340,7 @@
340340
<dependency>
341341
<groupId>org.json</groupId>
342342
<artifactId>json</artifactId>
343-
<version>20230227</version>
343+
<version>20240303</version>
344344
</dependency>
345345
<dependency>
346346
<groupId>org.apache.logging.log4j</groupId>
@@ -439,7 +439,7 @@
439439
<dependency>
440440
<groupId>org.owasp.antisamy</groupId>
441441
<artifactId>antisamy</artifactId>
442-
<version>1.7.4</version>
442+
<version>1.7.6</version>
443443
</dependency>
444444
<dependency>
445445
<groupId>com.googlecode.owasp-java-html-sanitizer</groupId>
@@ -816,7 +816,7 @@
816816
<jackson.version>2.8.11</jackson.version>
817817
<bouncycastle.version>1.78.1</bouncycastle.version>
818818
<asm.version>8.0.1</asm.version>
819-
<guava.version>28.1-jre</guava.version>
819+
<guava.version>33.3.1-jre</guava.version>
820820
<jython.version>2.7.4</jython.version>
821821
<nekohtml.version>1.9.22</nekohtml.version>
822822
<log4j.version>2.20.0</log4j.version>
@@ -925,21 +925,24 @@
925925
<phase>validate</phase>
926926
<configuration>
927927
<target>
928-
<pathconvert property="compile_classpath_value" refid="maven.compile.classpath"/>
929-
<pathconvert property="runtime_classpath_value" refid="maven.runtime.classpath"/>
930-
<pathconvert property="test_classpath_value" refid="maven.test.classpath"/>
931-
<!--mvn properties shared with all modules while building project-->
928+
<pathconvert property="compile_classpath_value" refid="maven.compile.classpath" />
929+
<pathconvert property="runtime_classpath_value" refid="maven.runtime.classpath" />
930+
<pathconvert property="test_classpath_value" refid="maven.test.classpath" />
931+
<!--mvn
932+
properties shared with all modules while building project-->
932933
<propertyfile file="${project.build.directory}/mvn-ant-shared-build.properties">
933-
<!--required to set carbonio.buildinfo.version-->
934-
<entry key="mvn_revision" value="${revision}"/>
934+
<!--required
935+
to set carbonio.buildinfo.version-->
936+
<entry key="mvn_revision" value="${revision}" />
935937

936-
<!--properties needed by some ant tasks-->
937-
<entry key="compile_classpath" value="${compile_classpath_value}"/>
938-
<entry key="runtime_classpath" value="${runtime_classpath_value}"/>
939-
<entry key="test_classpath" value="${test_classpath_value}"/>
938+
<!--properties
939+
needed by some ant tasks-->
940+
<entry key="compile_classpath" value="${compile_classpath_value}" />
941+
<entry key="runtime_classpath" value="${runtime_classpath_value}" />
942+
<entry key="test_classpath" value="${test_classpath_value}" />
940943
</propertyfile>
941944
<propertyfile file="${project.build.directory}/mvn-ant-shared-build.properties">
942-
<entry key="mvn_revision" value="${revision}"/>
945+
<entry key="mvn_revision" value="${revision}" />
943946
</propertyfile>
944947
</target>
945948
</configuration>
@@ -1053,7 +1056,8 @@
10531056
<artifactId>maven-enforcer-plugin</artifactId>
10541057
<version>3.1.0</version>
10551058
<dependencies>
1056-
<!-- https://github-wiki-see.page/m/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Checker-Enforcer-Rule -->
1059+
<!--
1060+
https://github-wiki-see.page/m/GoogleCloudPlatform/cloud-opensource-java/wiki/Linkage-Checker-Enforcer-Rule -->
10571061
<dependency>
10581062
<groupId>com.google.cloud.tools</groupId>
10591063
<artifactId>linkage-checker-enforcer-rules</artifactId>
@@ -1075,10 +1079,10 @@
10751079
<configuration>
10761080
<rules>
10771081
<!-- No duplicate version of dependency in POM -->
1078-
<banDuplicatePomDependencyVersions/>
1082+
<banDuplicatePomDependencyVersions />
10791083
<!-- Dependencies must converge.
10801084
If it fails use dependency management to declare which one to use. -->
1081-
<dependencyConvergence/>
1085+
<dependencyConvergence />
10821086
</rules>
10831087
</configuration>
10841088
</execution>
@@ -1147,4 +1151,4 @@
11471151
</plugins>
11481152
</build>
11491153

1150-
</project>
1154+
</project>

soap/pom.xml

+11-7
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,10 @@
152152
</goals>
153153
<configuration>
154154
<target>
155-
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
155+
<taskdef classpathref="maven.plugin.classpath"
156+
resource="net/sf/antcontrib/antlib.xml" />
156157
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
157-
<target name="generate-soap-api-doc"/>
158+
<target name="generate-soap-api-doc" />
158159
</ant>
159160
</target>
160161
</configuration>
@@ -166,9 +167,10 @@
166167
</goals>
167168
<configuration>
168169
<target>
169-
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
170+
<taskdef classpathref="maven.plugin.classpath"
171+
resource="net/sf/antcontrib/antlib.xml" />
170172
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
171-
<target name="generate-soap-api-changelog"/>
173+
<target name="generate-soap-api-changelog" />
172174
</ant>
173175
</target>
174176
</configuration>
@@ -181,9 +183,10 @@
181183
</goals>
182184
<configuration>
183185
<target>
184-
<taskdef classpathref="maven.plugin.classpath" resource="net/sf/antcontrib/antlib.xml"/>
186+
<taskdef classpathref="maven.plugin.classpath"
187+
resource="net/sf/antcontrib/antlib.xml" />
185188
<ant antfile="${basedir}/ant-generate-soap-docs.xml">
186-
<target name="generate-wsdl"/>
189+
<target name="generate-wsdl" />
187190
</ant>
188191
</target>
189192
</configuration>
@@ -193,6 +196,7 @@
193196
<plugin>
194197
<groupId>org.apache.maven.plugins</groupId>
195198
<artifactId>maven-source-plugin</artifactId>
199+
<version>3.3.1</version>
196200
<executions>
197201
<execution>
198202
<id>attach-sources</id>
@@ -207,4 +211,4 @@
207211
</build>
208212

209213

210-
</project>
214+
</project>

0 commit comments

Comments
 (0)