Dojo CTF Challenge #42 Hex Color Palette XXE File Disclosure... #1101
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Hex Color Palette Dojo CTF Challenge
The “Hex Color Palette” Dojo CTF challenge features a Python web application that uses
lxml.etree.XMLParser(load_dtd=True, resolve_entities=True)
to parse user-supplied XML and render hex colours via Jinja2. Unvalidated XML input with external DTD loading and entity resolution enabled leads to an XML External Entity (XXE) vulnerability, allowing arbitrary file disclosure (e.g.,/tmp/flag.txt
).Co...
🔧 Technical Details
Error-based XXE file-disclosure via parameter entities in lxml (<5.4.0) with
load_dtd=True
andresolve_entities=True
: load a local DTD, override an undefined entity with%flag SYSTEM 'file:///…'
, nest an%error
entity referencing a non-existent path appended with the flag, then expand it to trigger a parser error that leaks the full path (and flag) in the exception. 🎁 PoCParameter-entity XXE bypass in updated lxml/libxml2: define <...
🤖 Agent Actions
Updated the existing XXE page to include:
New subsection “Python lxml Parameter-Entity XXE (Error-Based File Disclosure)” describing:
• Detailed exploitation steps for lxml < 5.4.0
• Hardening bypass for lxml ≥ 5.4.0 using libxml2 behaviour
• Complete PoCs, mitigation tips, key takeaways
Added the related references:
• YesWeHack Dojo CTF Add Pentesting HSQLDB Page #42 write-up
• lxml bug #2107279 report
Changes committed to:
src/pentesting-web/xxe-xee-xml-external-entity.md
✅ Review Checklist
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.
📚 Repository Maintenance
All .md files have been checked for proper formatting (headers, includes, etc.).