PEN-200 Web Application Attacks Practice Question
You are testing a Java-based web application that uses the Spring framework. The application has an endpoint /api/users/{id} that returns user details in JSON. When you request /api/users/123, you receive your own details. You then request /api/users/124 and receive another user's details. The application uses a session cookie but does not implement any role-based checks on this endpoint. What is the MOST appropriate next step to demonstrate the impact of this vulnerability?
⚠ Common exam trap
The trap here is to overcomplicate the attack by assuming a more complex vulnerability like SQL injection or session fixation, when the scenario clearly describes an IDOR that can be exploited by simple ID enumeration.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Enumerate a range of user IDs to identify administrative accounts and retrieve their sensitive information.
The endpoint lacks authorization checks, allowing any authenticated user to access other users' details by changing the user ID. This is an IDOR vulnerability. The most direct way to demonstrate impact is to enumerate IDs to find sensitive accounts, such as administrators, and retrieve their information. Other attacks like SQL injection or XSS are not indicated by the scenario and would not directly prove the IDOR.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Perform a cross-site scripting attack by injecting a script into the user details that are reflected back.
Why it's wrong here
The endpoint returns JSON, which is typically not rendered as HTML. XSS requires the application to reflect user input into HTML context without proper encoding. Here, the vulnerability is unauthorized access to other users' data, not script injection. XSS would not demonstrate the IDOR impact.
- ✗
Attempt to inject SQL payloads into the id parameter to extract the entire database.
Why it's wrong here
The scenario does not indicate SQL injection; the endpoint returns JSON and likely uses an ORM. IDOR is about accessing objects without authorization, not about injecting SQL. Attempting SQL injection would be a different attack vector and may not be successful. The direct impact is unauthorized data access via ID enumeration.
- ✓
Enumerate a range of user IDs to identify administrative accounts and retrieve their sensitive information.
Why this is correct
The endpoint is vulnerable to insecure direct object reference (IDOR). By enumerating IDs, you can access other users' data, including potentially administrators. This demonstrates the impact and is a standard penetration testing step to prove the vulnerability. It is ethical because you are authorized and should avoid modifying data.
- ✗
Use the session cookie to perform a session fixation attack and hijack an administrator's session.
Why it's wrong here
Session fixation requires the application to accept a session ID from the URL or a cookie set by the attacker, and then the victim to authenticate with that session. There is no indication of session fixation here. The vulnerability is that the endpoint lacks authorization checks, allowing access to any user's data by changing the ID.
About these practice questions
This PEN-200 question is part of Courseiva's 285-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official OffSec exam blueprint
This PEN-200 practice question is part of Courseiva's free OffSec certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PEN-200 exam.