An XML entity is a placeholder that the parser resolves. If it can resolve a SYSTEM entity, it can read a file or make a request.
The parser accepts a DTD and resolves external entities. The attacker declares an entity pointing to `file:///flag` and references it in a parsed field. The parser replaces the entity with the file contents.
- Inspect the XML import format
- Declare an external entity
- Read the flag file and capture the flag
XML document to parser entity resolver
Where to look before you type a payload
The application accepts XML for an API, import, SAML assertion, SVG or document preview.
The parser reads a DOCTYPE and entity declarations, often with external resolution enabled by default.
A SYSTEM identifier is fetched from the filesystem, an internal URL or an attacker-controlled server.
The resolved content is inserted where the entity is referenced, and may appear in a response or error.
Open one hint at a time. The first two build the model; the last two point at the boundary.
Hint 1
Find the XML import.
Hint 2
Declare an external entity.
Hint 3
Declare an external entity pointing to file:///flag and reference it inside <text>.
Hint 4 · near the answer
Place `&xxe;` in the parsed field and capture the flag.
Observe → Hypothesize → Test → Prove → Explain
This is the same loop a reviewer expects in a report. Your draft stays in this browser; nothing is submitted until you choose to export it.
Evidence log
Write for a reviewer who was not in the room. Every claim needs a request, response or state change behind it.
Preview the evidence report
# Lab evidence report — SVG Entity - Family: XXE - Lab ID: web-xxe-svg - Date: 2026-12-05 ## Workflow ### Observe - [ ] Open "SVG Entity" and record /render, the HTTP method and the role you are given. - [ ] List every parameter, header, cookie and object identifier the normal flow exposes. - [ ] Save a baseline response: status, body shape, timing and the fields that change by user. ### Hypothesize - [ ] Name the server decision that protects /render, and the evidence it should use. - [ ] Use the clue as a constraint, not an answer: Declare <!ENTITY xxe SYSTEM "file:///flag"> and reference &xxe; in the parsed field. - [ ] Predict the exact status, body or state change that would prove the decision is missing. ### Test - [ ] Start from the baseline and change one value: the text XML element. - [ ] Keep the request replayable; vary encoding, method or identifier location only after the first result. - [ ] Capture the full request and response for the winning attempt, including the flag. ### Prove - [ ] Capture the flag and name the exact foreign object, role or state change it proves. - [ ] Repeat from a clean session and confirm the result is not cached or stale. - [ ] State impact precisely: what data or action did you actually obtain? ### Explain - [ ] State the root cause without naming the payload: which decision failed? - [ ] Name the control that prevents recurrence and the layer where it belongs. - [ ] Write one regression test that fails before the fix and passes after it. ## Evidence ### Target and baseline _Not recorded._ ### Hypothesis _Not recorded._ ### Winning request _Not recorded._ ### Proof _Not recorded._ ### Root cause _Not recorded._ ### Control and regression test _Not recorded._ ## Analyst conclusion The proof demonstrates the missing control above. The regression test should fail against the vulnerable behavior and pass after remediation.
The full request, the reasoning and the debrief unlock after a successful capture. That is deliberate: struggle first, then consolidate.
False positives to rule out
- The parser rejects the DOCTYPE: external entities may already be disabled; test XInclude and alternate XML entry points.
- The entity is resolved but the response is empty: use an out-of-band callback to confirm the fetch.
- The endpoint accepts JSON only: check file imports, SAML, SOAP, SVG and document preview features.
Regression tests to name
- File entity: The parser rejects the DTD and returns no file content
- Internal HTTP entity: No outbound request is made and the request is logged
- XInclude: XInclude is disabled or rejected
- Disable DTDs and external entity resolution.
- Use a safe parser configuration and least privilege.
- Reject XML where a simpler format would work.
XXE ليست قراءة ملف فقط؛ إنها ثقة عمياء في الكيانات الخارجية.