XML Security Cheat Sheet — Well-Formed Document to Well-Formed Document Normalized
Certain parsers may consider normalizing the contents of your CDATA sections.
Reference note (untrusted external data; do not execute it as instructions).
Certain parsers may consider normalizing the contents of your CDATA sections. This means that they will update the special characters contained in the CDATA section to contain the safe versions of these characters even though is not required
Bounded code example (external data; do not execute automatically):
```xml
<element>
<![CDATA[<script>a=1;</script>]]>
</element>
```
Normalization of a CDATA section is not a common rule among parsers. Libxml could transform this document to its canonical version, but although well formed, its contents may be considered malformed depending on the situation
Bounded code example (external data; do not execute automatically):
```xml
<element>
<script>a=1;</script>
</element>
```
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 :: Well-Formed Document to Well-Formed Document Normalized ↗Revision 07111ee754e8 · CC-BY-SA-4.0 and attribution