Abhishek M (Community Member) asked a question.

CWE ID 566 - I have a page where I take user input ( business name) from drop down and I perform if the user is authorised to that business from list and if yes I will send the userinput to hibernate session.get to get the corresponding business to enter

Veracode is reporting - In this call to org.hibernate.Session.get, a data access statement could be executed with a primary key that can be controlled by externally provided values. If the provided primary key is not properly validated and the underlying storage does not restrict access to only entities that the user should be granted access to, it may be possible for an attacker to reference unauthorized records.

 

Consider the user input is "businessId" and I have to fetch the corresponding businessId value from db before passing this as primary key in db I have performed input validation by only allowing characters "[A-Za-z0-9_ ]+" and my user authorisation is already in place , still veracode is reporting the issue.

 


Topics (5)

No articles found
Loading

Ask the Community

Get answers, share a use case, discuss your favorite features, or get input from the community.