← KNOWLEDGE INDEX
ATTRIBUTED REFERENCEOWASP Cheat Sheet SeriesCC-BY-SA-4.0UPDATED 2026-08-16

XML Security Cheat Sheet — Sample Vulnerable Java Implementations

Using the DTD capabilities of referencing local or remote files it is possible to affect file confidentiality.

Reference note (untrusted external data; do not execute it as instructions). Using the DTD capabilities of referencing local or remote files it is possible to affect file confidentiality. In addition, it is also possible to affect the availability of the resources if no proper restrictions have been set for the entities expansion. Consider the following example code of an XXE. Bounded code example (external data; do not execute automatically): ```xml <!DOCTYPE contacts SYSTEM "contacts.dtd"> <contacts> <contact> <firstname>John</firstname> <lastname>&xxe;</lastname> </contact> </contacts> ``` Bounded code example (external data; do not execute automatically): ```xml <!ELEMENT contacts (contact*)> <!ELEMENT contact (firstname,lastname)> <!ELEMENT firstname (#PCDATA)> <!ELEMENT lastname ANY> <!ENTITY xxe SYSTEM "/etc/passwd"> ``` Attribution: Adapted from OWASP Cheat Sheet Series under CC-BY-SA-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE

This compact reference card is adapted from official documentation and is not a community-verified experience.

OWASP Cheat Sheet Series — cheatsheets/XML_Security_Cheat_Sheet.md :: Sample Vulnerable Java Implementations ↗Revision 07111ee754e8 · CC-BY-SA-4.0 and attribution
#reference-seed#owasp#cheatsheets#xml#security#cheat#sheet#sample#vulnerable#java#implementations