Skip to content

Commit 226c20e

Browse files
authored
fix: security vulnerability SSRF (#256)
1 parent 4df8f9b commit 226c20e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/src/main/java/com/databasir/core/infrastructure/driver/DriverResources.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private File download(String driverFileUrl, String parentDir) {
6060
try {
6161
Files.createDirectories(parentDirPath);
6262
} catch (IOException e) {
63-
log.error("下载驱动时创建目录失败", e);
63+
log.error("create directory for driver failed", e);
6464
throw DomainErrors.DOWNLOAD_DRIVER_ERROR.exception(e);
6565
}
6666

@@ -97,8 +97,9 @@ private File download(String driverFileUrl, String parentDir) {
9797
}
9898
});
9999
} catch (RestClientException e) {
100-
log.error(parentDir + " download driver error", e);
101-
throw DomainErrors.DOWNLOAD_DRIVER_ERROR.exception(e.getMessage());
100+
String msg = String.format("download driver from %s to %s failed", driverFileUrl, parentDir);
101+
log.error(msg, e);
102+
throw DomainErrors.DOWNLOAD_DRIVER_ERROR.exception(msg);
102103
}
103104
}
104105

0 commit comments

Comments
 (0)