Skip to content

Commit 97aa0ff

Browse files
committed
IDOR Vulnerability documentation ready to commit
1 parent f2afa78 commit 97aa0ff

File tree

8 files changed

+100
-0
lines changed

8 files changed

+100
-0
lines changed
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
2+
# AppAttack x OnTrack Vulnerability review
3+
4+
## Team Member Name
5+
6+
| Name | Student ID |
7+
| ----------------------- | ---------- |
8+
| Atharv Sandip Bhandare | 223650012 |
9+
10+
---
11+
12+
## Vulnerability Details
13+
14+
### Vulnerability Name
15+
16+
Insecure Direct Object Reference (IDOR) – Unauthorized Access to Staff Information
17+
18+
### Vulnerability purpose
19+
20+
- This vulnerability targets Insecure Direct Object References (IDOR), where a low level user entity, such as a student, can access high level entity such as internal staff information through insufficient authorization checks on the server.
21+
- This vulnerability is made possible due to insufficient access control implementation on the backend, such as:
22+
- The API endpoint handling unit information does not perform role-based access control (RBAC) checks to differentiate between students and staff.
23+
- Sensitive fields like `main_convenor_id` and `tutor_id` are included by default in the API response, regardless of the user's role.
24+
- The system relies only on `authentication (whether the user is logged in)`, but fails to apply proper authorization filters to control what different types of users should see.
25+
- Lack of `object-level data filtering` or `data minimization practices` results in unnecessary information disclosure.
26+
27+
### Affected Assets and Interaction Points
28+
- Affected Assets:
29+
- Based on my understanding, the following backend files are involved in exposing unauthorized staff information and are part of the vulnerable assets:
30+
31+
| File | Why It Is Affected |
32+
| --- | --- |
33+
| `doubtfire-api/app/api/entities/minimal/minimal_user_entity.rb` | Handles minimal user serialization; insufficient filtering led to staff identifiers being exposed. |
34+
| `doubtfire-api/app/api/entities/unit_entity.rb` | Constructs the Unit API response; embeds sensitive staff IDs like `main_convenor_id` directly into API outputs without access control. |
35+
| `doubtfire-api/app/api/entities/unit_role_entity.rb` | Handles serialization of staff roles within a unit; vulnerable to leaking tutor information linked to students without authorization checks. |
36+
| `doubtfire-api/app/api/entities/user_entity.rb` | Manages user-level details; includes sensitive attributes when responding to certain requests. |
37+
| `doubtfire-api/app/api/unit_roles_api.rb` | API controller that processes staff role information; lack of proper authorization checks results in potential data exposure. |
38+
| `doubtfire-api/app/api/units_api.rb` | Main controller serving Unit information; sends out staff IDs embedded within the unit payload even for student-level users. |
39+
40+
- Interaction Points:
41+
- API Endpoint: `Get /api/units/:id`
42+
- When any user (even a student) queries unit information, the API response contains internal fields like main_convenor_id, tutor_id, exposing unauthorized mapping between students and staff.
43+
44+
- Tools Used to Expose Vulnerability:
45+
- Postman: Used to craft custom API requests and view raw JSON responses revealing sensitive internal IDs.
46+
- Burp Suite: Can be used for intercepting and analyzing insecure API responses systematically.
47+
48+
## Vulnerability outcomes
49+
50+
### Outcomes
51+
| Outcome | Impact on OnTrack |
52+
| ------------------------------- | ----------------- |
53+
| Unauthorized Viewing of Staff Assignments | Students could view staff assigned to units without permission, breaching confidentiality within academic operations. |
54+
| Exposure of Staff Internal Roles | Students could infer privileged internal staff roles (e.g., convenors, tutors), disrupting academic hierarchies and workflows. |
55+
| Potential Misuse of Staff Information | Exposed staff IDs could be used to impersonate staff members in unit activities, extension requests, or academic disputes. |
56+
| Degradation of Access Control Integrity | Trust in OnTrack’s role-based access control (RBAC) system could diminish, undermining secure separation between student and staff data. |
57+
| Increased Internal Support Burden | Staff would require additional support to manage privacy breaches, leading to administrative overhead and possible process changes. |
58+
59+
Vulnerability Exposure: ![data access](Resources/staff_data_before.png)
60+
- In the above screenshot, using Postman, a student user `(student_1)` successfully accessed sensitive staff information for a unit by sending a GET request to the endpoint
61+
`/api/units/1`.
62+
- The API response reveals sensitive details of staff, including their user IDs, email addresses, first and last names, usernames, and nicknames: all without appropriate authorization checks and improper data sanitization.
63+
- This demonstrates a clear violation of access control policies where non-privileged users (students) can retrieve confidential staff data.
64+
65+
## My Approach to Resolving the Vulnerability
66+
To address the identified IDOR vulnerability in the OnTrack system, I followed a structured and investigative approach:
67+
1. Initial Vulnerability Verification:
68+
- Using `Postman api`, I simulated a GET request to the vulnerable endpoint `/api/units/:id` with a student user's credentials (student_1), successfully exposing sensitive staff information (emails, full names, usernames) associated with the unit.
69+
2. Review of the Vulnerability Report:
70+
- Carefully reviewed the penetration testing report again to fully understand the scope and impact, which emphasized that staff-level information was improperly accessible to student-level users.
71+
3. Identification of Affected Assets:
72+
- Analyzed the backend repository (doubtfire-api) to identify relevant files that potentially exposed staff-related information without access control.
73+
4. Understanding How the Vulnerability Was Made Possible:
74+
- Investigated serialization logic inside the above entity and API files (specified in the outcomes section).
75+
- Found that sensitive staff data fields were included in the API responses without verifying user roles or privileges.
76+
- Lack of role-based access control (RBAC) or conditional serialization was the root cause.
77+
5. Designing the Remediation Strategy
78+
- Planned to implement Role-Based Access Control (RBAC) by restricting the fields returned based on the user's role (Student vs Staff/Admin).
79+
- Decided to refactor serialization methods in entities to exclude or sanitize sensitive staff attributes for unauthorized users.
80+
- Added a new helper (role_helpers.rb) to centralize RBAC logic for consistent access decisions across APIs.
81+
6. Implementation of Fixes:
82+
- Modified serialization logic in all affected entity files to conditionally expose sensitive data based on user roles.
83+
- Updated controller responses to ensure students receive only non-sensitive information.
84+
85+
## Vulnerability Validation
86+
`Note: Before starting OnTrack, make sure to be on 8.0.x branch and you have Postman Api installed in your system`
87+
1. Pull my work
88+
2. Start OnTrack locally and open your Postman Api alongside: ![setup](Resources/step_1.png)
89+
3. Now make a login `POST` request to the endpoint `http://localhost:3000/api/auth` and make sure to pass the credentials `username` and `password` as per the below screenshot then hit on `send`: ![step_2](Resources/step_2.png)
90+
- `201 Status` created means you have successfully made a request to the desired endpoint.
91+
- Now, make sure to copy the `auth_token`, it will be used later to make a `GET` request to the frontend.
92+
4. Now, make a `GET` request to the endpoint: `http://localhost:4200/api/units/1`, but make sure you have your headers(username, auth-token, content-type) properly setup as per the below image, here auth_token you can access it from step 3: ![step_4](Resources/step_4.png)
93+
5. Now, if you scroll down through the response section, and if you don't see any `json object` like below: ![check](Resources/staff_data_before.png)
94+
- It means sensitive staff data has been sanitized and proper Role-Based Access Control (RBAC) has been successfully implemented.
95+
96+
## Important Section:
97+
- After applying the fix to sanitize unauthorized staff information from the, it was observed that the OnTrack frontend login functionality is impacted.
98+
- Specifically, no users (Students, Tutors, Admins, Convenors) are currently able to successfully log in, and a `419 No authentication details provided` error is thrown.
99+
- This indicates that the frontend is tightly coupled with previously exposed staff object data, and further backend/frontend adjustments are required to properly align authorization models with user session handling.
100+
![error](Resources/error.png)
95.3 KB
Loading
127 KB
Loading
259 KB
Loading
388 KB
Loading
299 KB
Loading
45.3 KB
Loading
310 KB
Loading

0 commit comments

Comments
 (0)