Read Sensitive Information/Iterable Object Identifiers

Overview of the Vulnerability

Insecure Direct Object Reference (IDOR) occurs when there are no access control checks to verify if a request to interact with a resource is valid. An IDOR vulnerability within this application allows an attacker to read sensitive information by iterating through object identifiers.

Business Impact

IDOR can lead to reputational damage for the business through the impact to customers’ trust. The severity of the impact to the business is dependent on the sensitivity of the data being stored in, and transmitted by the application.

In the context of the vulnerable code provided, the primary category of the IDOR vulnerability would be:

Read Sensitive Information Iterable Object Identifiers

Gruames_Site/
    ├── templates/
    │   └── games/
    │       ├── dashboard.html
    │       ├── gamer_details.html
    │       ├── login.html
    │       └── logout.html
    ├── __init__.py
    ├── apps.py
    ├── forms.py
    ├── models.py
    ├── urls.py
    ├── views.py
    └── website/
        ├── __init__.py
        ├── settings.py
        ├── urls.py
        └── wsgi.py

Key Areas to Examine

  1. Gamer Profile Access: The gamer_profile view function in views.py is a potential area for IDOR vulnerabilities. Here’s the relevant code:

Potential IDOR Vulnerability

  • Gamer Profile Access: The gamer_profile function retrieves a GamerProfile object based on the gamer_id provided in the URL. If the gamer_id is simply an integer that corresponds to the primary key of the GamerProfile model, a user could potentially manipulate the URL to access

  • Read Sensitive Information: The gamer_profile function allows users to read (view) the details of a GamerProfile based on the gamer_id provided in the URL. If a user can manipulate this ID to access another user's profile, it constitutes a vulnerability.

  • Iterable Object Identifiers: The gamer_id is a predictable integer (the primary key of the GamerProfile model), which means that users can iterate through possible IDs (e.g., /gamer_profile/1/, /gamer_profile/2/, etc.) to access profiles they should not have permission to view

Lack of Access Control

  • No User Ownership Check: The code does not check if the logged-in user is the owner of the GamerProfile they are trying to access. This means that any authenticated user could potentially access any GamerProfile by guessing or iterating through IDs.

Example of How This Could Be Exploited

  1. User A has a gamer profile with gamer_id = 1.

  2. User B logs in and knows User A's gamer_id.

  3. User B accesses /gamer_profile/1/ and views User A's profile.

  4. User B changes the URL to /gamer_profile/2/ and accesses another user's profile, assuming they know the ID.

Recommendations to Mitigate IDOR

  1. Ownership Check: Before retrieving the GamerProfile, check if the logged-in user is the owner of that profile:

  • Use UUIDs or Random Tokens: Instead of using sequential integers for IDs, consider using UUIDs or random tokens that are not easily guessable.

  • Implement Role-Based Access Control (RBAC): Ensure that users can only access resources they are authorized to view based on their roles.

Summary

Thus, the vulnerability in the provided code falls under the category of Read Sensitive Information Iterable Object Identifiers, as it allows unauthorized users to read sensitive information (gamer profiles) by manipulating the object identifiers (gamer IDs) in the URL.

Here are some examples of types of websites and applications that have similar functionality, structure, and business logic to the code you provided, which could be vulnerable to IDOR weaknesses:

1. Online Gaming Platforms

  • Example: Websites like Twitch or Steam where users have profiles that display their gaming statistics, achievements, and friends lists.

  • Vulnerability: If user profiles are accessed via predictable IDs (e.g., /user/profile/123), an attacker could manipulate the URL to view other users' profiles, potentially exposing sensitive information like personal details, gaming history, or private messages.

2. Social Media Platforms for Gamers

  • Example: Platforms like Discord or GameBattles where users can create profiles, join teams, and share achievements.

  • Vulnerability: If users can access other users' profiles or team information by changing IDs in the URL, they could gain unauthorized access to private messages, team strategies, or sensitive user data.

3. Competitive Gaming Websites

  • Example: Websites like Battlefy or Challonge that host tournaments and allow users to create profiles, join teams, and view match statistics.

  • Vulnerability: If tournament participants can access each other's profiles or match results by manipulating URLs, it could lead to unauthorized access to sensitive competition data or personal information.

4. E-Sports Team Management Platforms

  • Example: Websites like GamerLink or TeamSpeak where users can manage teams, view player statistics, and communicate with team members.

  • Vulnerability: If team management features allow users to access other team members' profiles or statistics through predictable URLs, it could expose sensitive information about team strategies or player performance.

5. Gaming Community Forums

  • Example: Forums like NeoGAF or ResetEra where users have profiles that display their posts, achievements, and personal information.

  • Vulnerability: If users can access other members' profiles by changing the user ID in the URL, it could lead to unauthorized viewing of private messages, posts, or personal information.

6. Game Development Platforms

  • Example: Platforms like itch.io or Game Jolt where developers can create profiles, showcase their games, and interact with users.

  • Vulnerability: If developers can access each other's profiles or game statistics through predictable identifiers, it could expose sensitive information about game development processes or unpublished projects.

Conclusion

These types of websites and applications share similar functionality and business logic with the code you provided. They could be vulnerable to IDOR attacks if they do not implement proper access controls and validation checks on user permissions when accessing user-specific resources. To mitigate these risks, it is crucial to enforce strict access controls and validate user ownership before allowing access to sensitive information.


Steps to Reproduce

  1. Use a browser to navigate to: {{URL}}

  2. Login to User Account A

  3. In the URL bar, modify the parameter to a different value:

{{eg.https://example.com/parameter(UserAccountB)}}

  1. Observe that the application displays information of User Account B, as seen in the screenshot below:

{{screenshot}}

Proof of Concept (PoC)

Below is a screenshot demonstrating the exposed object executing:

{{screenshot}}

A malicious attacker could leverage this IDOR vulnerability to read data by using the following payload:

The following screenshot(s) demonstrate(s) this additional impact:

{{screenshot}}

Guidance

Provide a step-by-step walkthrough with a screenshot on how you exploited the vulnerability. This will speed triage time and result in faster rewards. Your submission must include evidence of the vulnerability and not be theoretical in nature.

To demonstrate access to sensitive information, self register two separate accounts and clearly demonstrate how you view the "victim" account information from the "attacker" account.

If identified, do not access or attempt to access sensitive information. Do not access Personally Identifiable Information (PII) as there are legal consequences to doing so.

Recommendation(s)

Preventing IDOR involves ensuring that each user accessible object is sufficiently protected. When an object is requested by an untrusted source, each request should pass through an access control check to ensure that the user has authorization to access that object.

These authorization checks should also occur when a known user requests a resource so that the users can only access data from within their intended permissions group.

Additionally, hash functions and hashed strings should be used to map an object instead of a direct ID, so that it is not a predictable value and easily guessed.

For more information, refer to the following resource:

Last updated