简体   繁体   中英

Improper Resource Access Authorization error in checkmarx when reading a property

Checkmarx report is showing Improper Resource Access Authorization for the following line.

String endPoint=prop.getProperty("endpoint");

As mentioned in this answer, I have added access control check before reading the property. But checkmarx report is still showing the error.

String user="admin";
if(user.equals("admin")) {
    String endPoint=prop.getProperty("endpoint");
}

解决了这样的问题

 String endPoint=(String)prop.getOrDefault("endpoint", null );

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM