Coders Conquer Security: Share & Learn Series: Insecure Direct Object Reference
URLs are essential to navigating all the websites and web applications we know and love. Their basic function is to identify where resources are and how to retrieve them. While URLs are necessary for the World Wide Web to work, they can also pose a security risk if not secured properly.
In this post, we will learn:
- What IDOR is and how attackers use IDOR
- Why IDOR is dangerous
- Techniques that can fix this vulnerability
Understand IDOR
A direct object reference is when a specific record (the "object"), is referenced within an application. It usually takes the form of a unique identifier and may appear in a URL.
For instance, you might notice something like "?id=12345" at the end of a URL. The number, 12345, is a reference to a specific record. Security vulnerabilities creep in when access control is not present for individual records. This allows users to access records and data they shouldn't see. This is an attack that requires a relatively low skill level.
In this instance, let's say an attacker changes the ID in the URL to 12344. In an application that is vulnerable to IDOR, the attacker would be able to see the data pertaining to that record.
How much damage can this type of vulnerability really cause?
Know Why IDOR is Dangerous
When developers are not careful, they can design a system that displays and leaks application records in various places. A breach of this magnitude can be significant, especially when sensitive data or PII are involved.
The Australian Tax Office set up a website to help businesses collect a new tax. Unfortunately, it came packaged with the unwanted feature of an IDOR vulnerability. An inquisitive user realized that the URLs within the site contained his Australian Business Number, or ABN. It just so happens that this is an easily discoverable number for any registered business. This user decided to put the numbers of other companies into the URL. He was gifted with their bank account information and personal details!
Apple recently fell victim to an IDOR vulnerability. When the iPad was first released, 114,000 customer email addresses were leaked. (To be fair, it was more a mistake on AT&T's part).
You see, AT&T built a service to support 3G connectivity for iPads. The iPad sent an identifier stored on the SIM card to AT&T's service. The service then returned the user's email address.
Unfortunately, these identifiers were simply sequential integers and thus were easily guessable. Attackers iterated through the identifiers and stole the email addresses.
Another mistake was that AT&T's service tried to "secure" the service by only returning the email address if the request's user-agent header indicated that it came from an iPad. The user-agent is only a string value that can be easily manipulated.
IDOR vulnerabilities can be subtle and sneaky. Let's discuss how to defeat them.
Defeating IDOR
Access control is the key to solving IDOR. When a user requests a specific record, make sure they are authorized to view the requested record.
Using centralized authorization modules is the best way to do this. Tools such as Spring Security provide robust and customizable authentication and authorization for applications.
Bottom line: have one module that all other code relies upon to perform authorization checks.
Another common mitigation is the use of surrogate references. Instead of using the actual database record identifiers in your URLs, you can create random numbers that map back to the actual records.
Using surrogate references ensures that an attacker cannot get to a record just by guessing the next valid identifier.
And finally, don't rely on anything that the user can manipulate to provide authorization. AT&T tried to use the user-agent header to authorize their service. Don't rely on HTTP headers, cookies, or GET and POST parameters.
With these mitigations in place, IDOR will be a thing of the past.
Secure Your References
Insecure Direct Object References are one of the easiest vulnerabilities to exploit. Don't let them sneak up on you when you least expect it. Always check that users are authorized. Don't use real database identifiers. Don't depend on user-controlled data for authorization.
Build your mastery by checking out our Learning Resources. By practicing how to mitigate IDOR vulnerabilities in the language of your choice, you'll have no problem finding and fixing this problem in your production codebases. You can also put your newfound defensive knowledge to the test with a free demo of the Secure Code Warrior platform, which trains cybersecurity teams to become the ultimate cyber warriors. To learn more about defeating this vulnerability, and a rogues'gallery of other threats, visit the Secure Code Warrior blog.
Ready to defend against IDOR attacks right now? Head to the platform and challenge yourself for free: [Start Here]
A direct object reference is when a specific record (the 'object'), is referenced within an application. It usually takes the form of a unique identifier and may appear in a URL.
Jaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoJaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.
URLs are essential to navigating all the websites and web applications we know and love. Their basic function is to identify where resources are and how to retrieve them. While URLs are necessary for the World Wide Web to work, they can also pose a security risk if not secured properly.
In this post, we will learn:
- What IDOR is and how attackers use IDOR
- Why IDOR is dangerous
- Techniques that can fix this vulnerability
Understand IDOR
A direct object reference is when a specific record (the "object"), is referenced within an application. It usually takes the form of a unique identifier and may appear in a URL.
For instance, you might notice something like "?id=12345" at the end of a URL. The number, 12345, is a reference to a specific record. Security vulnerabilities creep in when access control is not present for individual records. This allows users to access records and data they shouldn't see. This is an attack that requires a relatively low skill level.
In this instance, let's say an attacker changes the ID in the URL to 12344. In an application that is vulnerable to IDOR, the attacker would be able to see the data pertaining to that record.
How much damage can this type of vulnerability really cause?
Know Why IDOR is Dangerous
When developers are not careful, they can design a system that displays and leaks application records in various places. A breach of this magnitude can be significant, especially when sensitive data or PII are involved.
The Australian Tax Office set up a website to help businesses collect a new tax. Unfortunately, it came packaged with the unwanted feature of an IDOR vulnerability. An inquisitive user realized that the URLs within the site contained his Australian Business Number, or ABN. It just so happens that this is an easily discoverable number for any registered business. This user decided to put the numbers of other companies into the URL. He was gifted with their bank account information and personal details!
Apple recently fell victim to an IDOR vulnerability. When the iPad was first released, 114,000 customer email addresses were leaked. (To be fair, it was more a mistake on AT&T's part).
You see, AT&T built a service to support 3G connectivity for iPads. The iPad sent an identifier stored on the SIM card to AT&T's service. The service then returned the user's email address.
Unfortunately, these identifiers were simply sequential integers and thus were easily guessable. Attackers iterated through the identifiers and stole the email addresses.
Another mistake was that AT&T's service tried to "secure" the service by only returning the email address if the request's user-agent header indicated that it came from an iPad. The user-agent is only a string value that can be easily manipulated.
IDOR vulnerabilities can be subtle and sneaky. Let's discuss how to defeat them.
Defeating IDOR
Access control is the key to solving IDOR. When a user requests a specific record, make sure they are authorized to view the requested record.
Using centralized authorization modules is the best way to do this. Tools such as Spring Security provide robust and customizable authentication and authorization for applications.
Bottom line: have one module that all other code relies upon to perform authorization checks.
Another common mitigation is the use of surrogate references. Instead of using the actual database record identifiers in your URLs, you can create random numbers that map back to the actual records.
Using surrogate references ensures that an attacker cannot get to a record just by guessing the next valid identifier.
And finally, don't rely on anything that the user can manipulate to provide authorization. AT&T tried to use the user-agent header to authorize their service. Don't rely on HTTP headers, cookies, or GET and POST parameters.
With these mitigations in place, IDOR will be a thing of the past.
Secure Your References
Insecure Direct Object References are one of the easiest vulnerabilities to exploit. Don't let them sneak up on you when you least expect it. Always check that users are authorized. Don't use real database identifiers. Don't depend on user-controlled data for authorization.
Build your mastery by checking out our Learning Resources. By practicing how to mitigate IDOR vulnerabilities in the language of your choice, you'll have no problem finding and fixing this problem in your production codebases. You can also put your newfound defensive knowledge to the test with a free demo of the Secure Code Warrior platform, which trains cybersecurity teams to become the ultimate cyber warriors. To learn more about defeating this vulnerability, and a rogues'gallery of other threats, visit the Secure Code Warrior blog.
Ready to defend against IDOR attacks right now? Head to the platform and challenge yourself for free: [Start Here]
URLs are essential to navigating all the websites and web applications we know and love. Their basic function is to identify where resources are and how to retrieve them. While URLs are necessary for the World Wide Web to work, they can also pose a security risk if not secured properly.
In this post, we will learn:
- What IDOR is and how attackers use IDOR
- Why IDOR is dangerous
- Techniques that can fix this vulnerability
Understand IDOR
A direct object reference is when a specific record (the "object"), is referenced within an application. It usually takes the form of a unique identifier and may appear in a URL.
For instance, you might notice something like "?id=12345" at the end of a URL. The number, 12345, is a reference to a specific record. Security vulnerabilities creep in when access control is not present for individual records. This allows users to access records and data they shouldn't see. This is an attack that requires a relatively low skill level.
In this instance, let's say an attacker changes the ID in the URL to 12344. In an application that is vulnerable to IDOR, the attacker would be able to see the data pertaining to that record.
How much damage can this type of vulnerability really cause?
Know Why IDOR is Dangerous
When developers are not careful, they can design a system that displays and leaks application records in various places. A breach of this magnitude can be significant, especially when sensitive data or PII are involved.
The Australian Tax Office set up a website to help businesses collect a new tax. Unfortunately, it came packaged with the unwanted feature of an IDOR vulnerability. An inquisitive user realized that the URLs within the site contained his Australian Business Number, or ABN. It just so happens that this is an easily discoverable number for any registered business. This user decided to put the numbers of other companies into the URL. He was gifted with their bank account information and personal details!
Apple recently fell victim to an IDOR vulnerability. When the iPad was first released, 114,000 customer email addresses were leaked. (To be fair, it was more a mistake on AT&T's part).
You see, AT&T built a service to support 3G connectivity for iPads. The iPad sent an identifier stored on the SIM card to AT&T's service. The service then returned the user's email address.
Unfortunately, these identifiers were simply sequential integers and thus were easily guessable. Attackers iterated through the identifiers and stole the email addresses.
Another mistake was that AT&T's service tried to "secure" the service by only returning the email address if the request's user-agent header indicated that it came from an iPad. The user-agent is only a string value that can be easily manipulated.
IDOR vulnerabilities can be subtle and sneaky. Let's discuss how to defeat them.
Defeating IDOR
Access control is the key to solving IDOR. When a user requests a specific record, make sure they are authorized to view the requested record.
Using centralized authorization modules is the best way to do this. Tools such as Spring Security provide robust and customizable authentication and authorization for applications.
Bottom line: have one module that all other code relies upon to perform authorization checks.
Another common mitigation is the use of surrogate references. Instead of using the actual database record identifiers in your URLs, you can create random numbers that map back to the actual records.
Using surrogate references ensures that an attacker cannot get to a record just by guessing the next valid identifier.
And finally, don't rely on anything that the user can manipulate to provide authorization. AT&T tried to use the user-agent header to authorize their service. Don't rely on HTTP headers, cookies, or GET and POST parameters.
With these mitigations in place, IDOR will be a thing of the past.
Secure Your References
Insecure Direct Object References are one of the easiest vulnerabilities to exploit. Don't let them sneak up on you when you least expect it. Always check that users are authorized. Don't use real database identifiers. Don't depend on user-controlled data for authorization.
Build your mastery by checking out our Learning Resources. By practicing how to mitigate IDOR vulnerabilities in the language of your choice, you'll have no problem finding and fixing this problem in your production codebases. You can also put your newfound defensive knowledge to the test with a free demo of the Secure Code Warrior platform, which trains cybersecurity teams to become the ultimate cyber warriors. To learn more about defeating this vulnerability, and a rogues'gallery of other threats, visit the Secure Code Warrior blog.
Ready to defend against IDOR attacks right now? Head to the platform and challenge yourself for free: [Start Here]
Click on the link below and download the PDF of this resource.
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
View reportBook a demoJaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.
URLs are essential to navigating all the websites and web applications we know and love. Their basic function is to identify where resources are and how to retrieve them. While URLs are necessary for the World Wide Web to work, they can also pose a security risk if not secured properly.
In this post, we will learn:
- What IDOR is and how attackers use IDOR
- Why IDOR is dangerous
- Techniques that can fix this vulnerability
Understand IDOR
A direct object reference is when a specific record (the "object"), is referenced within an application. It usually takes the form of a unique identifier and may appear in a URL.
For instance, you might notice something like "?id=12345" at the end of a URL. The number, 12345, is a reference to a specific record. Security vulnerabilities creep in when access control is not present for individual records. This allows users to access records and data they shouldn't see. This is an attack that requires a relatively low skill level.
In this instance, let's say an attacker changes the ID in the URL to 12344. In an application that is vulnerable to IDOR, the attacker would be able to see the data pertaining to that record.
How much damage can this type of vulnerability really cause?
Know Why IDOR is Dangerous
When developers are not careful, they can design a system that displays and leaks application records in various places. A breach of this magnitude can be significant, especially when sensitive data or PII are involved.
The Australian Tax Office set up a website to help businesses collect a new tax. Unfortunately, it came packaged with the unwanted feature of an IDOR vulnerability. An inquisitive user realized that the URLs within the site contained his Australian Business Number, or ABN. It just so happens that this is an easily discoverable number for any registered business. This user decided to put the numbers of other companies into the URL. He was gifted with their bank account information and personal details!
Apple recently fell victim to an IDOR vulnerability. When the iPad was first released, 114,000 customer email addresses were leaked. (To be fair, it was more a mistake on AT&T's part).
You see, AT&T built a service to support 3G connectivity for iPads. The iPad sent an identifier stored on the SIM card to AT&T's service. The service then returned the user's email address.
Unfortunately, these identifiers were simply sequential integers and thus were easily guessable. Attackers iterated through the identifiers and stole the email addresses.
Another mistake was that AT&T's service tried to "secure" the service by only returning the email address if the request's user-agent header indicated that it came from an iPad. The user-agent is only a string value that can be easily manipulated.
IDOR vulnerabilities can be subtle and sneaky. Let's discuss how to defeat them.
Defeating IDOR
Access control is the key to solving IDOR. When a user requests a specific record, make sure they are authorized to view the requested record.
Using centralized authorization modules is the best way to do this. Tools such as Spring Security provide robust and customizable authentication and authorization for applications.
Bottom line: have one module that all other code relies upon to perform authorization checks.
Another common mitigation is the use of surrogate references. Instead of using the actual database record identifiers in your URLs, you can create random numbers that map back to the actual records.
Using surrogate references ensures that an attacker cannot get to a record just by guessing the next valid identifier.
And finally, don't rely on anything that the user can manipulate to provide authorization. AT&T tried to use the user-agent header to authorize their service. Don't rely on HTTP headers, cookies, or GET and POST parameters.
With these mitigations in place, IDOR will be a thing of the past.
Secure Your References
Insecure Direct Object References are one of the easiest vulnerabilities to exploit. Don't let them sneak up on you when you least expect it. Always check that users are authorized. Don't use real database identifiers. Don't depend on user-controlled data for authorization.
Build your mastery by checking out our Learning Resources. By practicing how to mitigate IDOR vulnerabilities in the language of your choice, you'll have no problem finding and fixing this problem in your production codebases. You can also put your newfound defensive knowledge to the test with a free demo of the Secure Code Warrior platform, which trains cybersecurity teams to become the ultimate cyber warriors. To learn more about defeating this vulnerability, and a rogues'gallery of other threats, visit the Secure Code Warrior blog.
Ready to defend against IDOR attacks right now? Head to the platform and challenge yourself for free: [Start Here]
Table of contents
Jaap Karan Singh is a Secure Coding Evangelist, Chief Singh and co-founder of Secure Code Warrior.
Secure Code Warrior is here for your organization to help you secure code across the entire software development lifecycle and create a culture in which cybersecurity is top of mind. Whether you’re an AppSec Manager, Developer, CISO, or anyone involved in security, we can help your organization reduce risks associated with insecure code.
Book a demoDownloadResources to get you started
Benchmarking Security Skills: Streamlining Secure-by-Design in the Enterprise
The Secure-by-Design movement is the future of secure software development. Learn about the key elements companies need to keep in mind when they think about a Secure-by-Design initiative.
DigitalOcean Decreases Security Debt with Secure Code Warrior
DigitalOcean's use of Secure Code Warrior training has significantly reduced security debt, allowing teams to focus more on innovation and productivity. The improved security has strengthened their product quality and competitive edge. Looking ahead, the SCW Trust Score will help them further enhance security practices and continue driving innovation.
Resources to get you started
The Benefits of Benchmarking Security Skills for Developers
The growing focus on secure code and Secure-by-Design principles requires developers to be trained in cybersecurity from the start of the SDLC, with tools like Secure Code Warrior’s Trust Score helping measure and improve their progress.
Driving Meaningful Success for Enterprise Secure-by-Design Initiatives
Our latest research paper, Benchmarking Security Skills: Streamlining Secure-by-Design in the Enterprise is the result of deep analysis of real Secure-by-Design initiatives at the enterprise level, and deriving best practice approaches based on data-driven findings.
Deep Dive: Navigating the Critical CUPS Vulnerability in GNU-Linux Systems
Discover the latest security challenges facing Linux users as we explore recent high-severity vulnerabilities in the Common UNIX Printing System (CUPS). Learn how these issues may lead to potential Remote Code Execution (RCE) and what you can do to protect your systems.
Coders Conquer Security: Share & Learn - Cross-Site Scripting (XSS)
Cross-site scripting (XSS) uses the trust of browsers and ignorance of users to steal data, take over accounts, and deface websites; it's a vulnerability that can get very ugly, very quickly. Let's take a look at how XSS works, what damage can be done, and how to prevent it.