I have this code in java, for the use of the properties file, but when executing the secure code scan with MicroFocus FortiFy OWASP Top 10 2017, it generates issues of type "A1 Injection" and "A5 Broken Access Control" in the line that implements the method java.util.Properties.load(). I couldn't find the solution for this problem. The property file is outside the build WAR in a different directory.
My Code:
public void initPop() {
logger.info("Cargar archivo de propiedades en memoria");
String configProp = "config.properties";
try {
Properties prop = new Properties();
InputStream inputSt = new FileInputStream("/home/ejm/properties/" + configProp);
prop.load(inputSt);
Map<String, String> help = new HashMap<String, String>();
for (Enumeration<?> names = prop.keys(); names.hasMoreElements();) {
String key = (String) names.nextElement();
help.put(key, prop.getProperty(key));
}
setLstProp(help);
inputSt.close();
prop.clear();
} catch (Exception ex) {
logger.error("[getValue] Archivo " + configProp + " no encontrado : " + ex.toString());
}
}
MicroFocus FortiFy OWASP Top 10 2017 Report:
