×

iFour Logo

Secure web application from Insecure direct object references

iFour Team - September 05, 2017

Listening is fun too.

Straighten your back and cherish with coffee - PLAY !

  • play
  • pause
  • pause
Secure Web Application from Insecure Direct Object References

‘Insecure direct object references’ is ranked 4th on the list OWASP top 10 vulnerabilities 2013. Now days, it has become a serious concern for software development companies to maintain the privacy of all the users. This vulnerability breaches the authorization gates and allow an attacker to thieve unauthorized data from web application. Let’s have detailed understanding of this vulnerability .

What is insecure direct object references?


According to OWASP definition insecure direct object references occur when web application gives direct access to those objects which are based on user-supplied input. As a result, an attacker can bypass the authorization gates and gain the access of resources of the system directly, like database files and records.

This vulnerability allows the attacker to bypass authorization steps of an application and have the access of all the resources directly by modifying the values of parameter which is used to point an object. These kinds of resources can be files of system, entries belonging to other users, etc. This happens because the application takes user supplied input and retrieve an object without checking sufficient authorization.

How can you know you are vulnerable?


Here are some easy ways to find out if your web application is vulnerable or not.
  • Does the application verify the exact user and the resources he is given access to? (For all direct references to restricted resources)

  • Suppose the reference is an indirect reference, you need to verify if the mapping to the direct references fail to restrict the values for authorized current user.

Code review of any application by custom web application companies can identify whether we can apply either approach safely or not. In most of the cases manual testing is proved to be effective to identify direct object references and check whether they are safe or not. Automated tools generally cannot look for such flaws as they cannot distinguish protection what is safe and what is not.

Let’s have a demo website where an object id is 3 which can be seen like this.

Here is the object (A user profile)

Demo Image


 
Demo Image

Now if we just change id from id=3 to id=1 in URL, we can see that we are directly given access to that object on id=1.

 
Demo Image
 
Demo Image
 

Severity:Medium

Prevention


To prevent this vulnerability from your web application, web application software companies suggests to create a map with in your code that maps objects. These objects could be referenced internally to aliased terms which are exposed to the user. For example, an array of primary keys to a particular table might be mapped with random sequence of integers. When the value is submitted by user, the number is matched to a real value. This prevents disclosure of the actual value and also limits what a user can alter.

Looking to Hire the Best Web Development Company? Contact Now

For example,

default --> index.html

account_summary --> account_summary.html

user_profile --> user_profile.html

Values supplied by the user should be vetted through an access control function to verify that he is authorized for that data.

 

Secure web application from Insecure direct object references ‘Insecure direct object references’ is ranked 4th on the list OWASP top 10 vulnerabilities 2013. Now days, it has become a serious concern for software development companies to maintain the privacy of all the users. This vulnerability breaches the authorization gates and allow an attacker to thieve unauthorized data from web application. Let’s have detailed understanding of this vulnerability . What is insecure direct object references? According to OWASP definition insecure direct object references occur when web application gives direct access to those objects which are based on user-supplied input. As a result, an attacker can bypass the authorization gates and gain the access of resources of the system directly, like database files and records. This vulnerability allows the attacker to bypass authorization steps of an application and have the access of all the resources directly by modifying the values of parameter which is used to point an object. These kinds of resources can be files of system, entries belonging to other users, etc. This happens because the application takes user supplied input and retrieve an object without checking sufficient authorization. Read More: Web Application Development Using Asp.net Blazor Framework How can you know you are vulnerable? Here are some easy ways to find out if your web application is vulnerable or not. Does the application verify the exact user and the resources he is given access to? (For all direct references to restricted resources) Suppose the reference is an indirect reference, you need to verify if the mapping to the direct references fail to restrict the values for authorized current user. Code review of any application by custom web application companies can identify whether we can apply either approach safely or not. In most of the cases manual testing is proved to be effective to identify direct object references and check whether they are safe or not. Automated tools generally cannot look for such flaws as they cannot distinguish protection what is safe and what is not. Let’s have a demo website where an object id is 3 which can be seen like this. Here is the object (A user profile)   Now if we just change id from id=3 to id=1 in URL, we can see that we are directly given access to that object on id=1.       Severity:Medium Prevention To prevent this vulnerability from your web application, web application software companies suggests to create a map with in your code that maps objects. These objects could be referenced internally to aliased terms which are exposed to the user. For example, an array of primary keys to a particular table might be mapped with random sequence of integers. When the value is submitted by user, the number is matched to a real value. This prevents disclosure of the actual value and also limits what a user can alter. Looking to Hire the Best Web Development Company? Contact Now See here For example, default --> index.html account_summary --> account_summary.html user_profile --> user_profile.html Values supplied by the user should be vetted through an access control function to verify that he is authorized for that data.  

Build Your Agile Team

Enter your e-mail address Please enter valid e-mail

Categories

Ensure your sustainable growth with our team

Talk to our experts
Sustainable
Sustainable
 

Blog Our insights

Power Apps vs Power Automate: When to Use What?
Power Apps vs Power Automate: When to Use What?

I often see people asking questions like “Is Power App the same as Power Automate?”. “Are they interchangeable or have their own purpose?”. We first need to clear up this confusion...

Azure DevOps Pipeline Deployment for Competitive Business: The Winning Formula
Azure DevOps Pipeline Deployment for Competitive Business: The Winning Formula

We always hear about how important it is to be competitive and stand out in the market. But as an entrepreneur, how would you truly set your business apart? Is there any way to do...

React 18 Vs React 19: Key Differences To Know For 2024
React 18 Vs React 19: Key Differences To Know For 2024

Ever wondered how a simple technology can spark a revolution in the IT business? Just look at React.js - a leading Front-end JS library released in 2013, has made it possible. Praised for its seamless features, React.js has altered the way of bespoke app development with its latest versions released periodically. React.js is known for building interactive user interfaces and has been evolving rapidly to meet the demands of modern web development. Thus, businesses lean to hire dedicated React.js developers for their projects. React.js 19 is the latest version released and people are loving its amazing features impelling them for its adoption.