Path manipulation issue in spring boot

521 Views Asked by At

I am using this code to read all the files in Java folder with which are ending with ".properties".

@Value("classpath*:com/tech/java/*.properties")
    private Resource[] files;

for (Resource resource : files) {

File file = resource.getFile();

try (BufferedReader br = new BufferedReader(new FileReader(file))) {

Fortify scan is failing at try (BufferedReader br = new BufferedReader(new FileReader(file))) with the security vulnerability saying that there is a chance of path manipulation.

0

There are 0 best solutions below