Search code examples
javasqldatabaseauthorizationcheckmarx

Checkmarx Improper Resource Access Authorization


I am using the Checkmarx security tool to scan my code, it is saying that when I execute executeUpdate() commands to the database that is "Improper Resource Access Authorization."

Various Googling with no success.

int rowInserted = preparedStatement.executeUpdate();

Solution

  • Add some code that performs access control checks that makes use of words like "admin", "authoriz" or "allowed"

     if (user.equals("admin")){
        int rowInserted = preparedStatement.executeUpdate();
     }