Can somebody please help me know java coding solution for below Vera code canning error?
I am creating a file and passing file location as argument.
File file1=new File(filePath);
**CWE-73: External Control of File Name or Path**
Can somebody please help me know java coding solution for below Vera code canning error?
I am creating a file and passing file location as argument.
File file1=new File(filePath);
**CWE-73: External Control of File Name or Path**
You can use the:
Validator validator = ESAPI.validator();
validator.getValidDirectoryPath(..) // to validate the directory path
validator.getValidFileName(...) // to validate the file name
and then use them to create your file