fixed #5154,avoid spring RCE

This commit is contained in:
jianghang.loujh
2024-06-06 15:29:17 +08:00
parent d66a15fe35
commit 7bb619cf12
7 changed files with 17 additions and 3 deletions

View File

@@ -25,6 +25,9 @@ import org.springframework.util.PropertyPlaceholderHelper;
public class YamlUtils {
public static <T> T resourceYmlToObj(String resource, String prefix, Class<T> clazz) {
if (!StringUtils.startsWithIgnoreCase("classpath:", resource)) {
resource = "classpath:" + resource;
}
ClassPathResource classPathResource = new ClassPathResource(resource);
String content;