Skip to content

Commit

Permalink
merge dev/4.2.2 into main (#915)
Browse files Browse the repository at this point in the history
merge dev/4.2.2 into main
  • Loading branch information
yhilmare authored Nov 27, 2023
2 parents 526d3ea + 1284a39 commit f080e56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public static void setValueIntoStatement(CallableStatement statement, int index,
public static Object getValueFromStatement(CallableStatement statement, int index, String type)
throws SQLException {
JDBCType jdbcType = parseDataType(type);
if (null == statement.getString(index)) {
if (null == statement.getObject(index)) {
return null;
}
switch (jdbcType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ private void init(DruidDataSource dataSource) {
properties.setProperty("allowLoadLocalInfile", "false");
properties.setProperty("allowUrlInLocalInfile", "false");
properties.setProperty("allowLoadLocalInfileInPath", "");
properties.setProperty("autoDeserialize", "false");
dataSource.setConnectProperties(properties);
try {
setConnectAndSocketTimeoutFromJdbcUrl(dataSource);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ public static Map<String, String> getJdbcParams(@NonNull ConnectionConfig connec
// fix arbitrary file reading vulnerability
jdbcUrlParams.put("allowLoadLocalInfile", "false");
jdbcUrlParams.put("allowUrlInLocalInfile", "false");
jdbcUrlParams.put("allowLoadLocalInfileInPath", "");
jdbcUrlParams.put("autoDeserialize", "false");
return jdbcUrlParams;
}

Expand All @@ -198,6 +200,7 @@ public DataSource getDataSource() {
properties.setProperty("allowLoadLocalInfile", "false");
properties.setProperty("allowUrlInLocalInfile", "false");
properties.setProperty("allowLoadLocalInfileInPath", "");
properties.setProperty("autoDeserialize", "false");
dataSource.setConnectionProperties(properties);
if (autoCommit != null) {
dataSource.setAutoCommit(autoCommit);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public TestResult test(String jdbcUrl, String username, String password, int que
properties.setProperty("allowLoadLocalInfile", "false");
properties.setProperty("allowUrlInLocalInfile", "false");
properties.setProperty("allowLoadLocalInfileInPath", "");
properties.setProperty("autoDeserialize", "false");
TestResult testResult = test(jdbcUrl, properties, queryTimeout);
if (testResult.getErrorCode() != null) {
return testResult;
Expand Down

0 comments on commit f080e56

Please sign in to comment.