Releases: xmldom/xmldom
0.9.10
Fixed
- Security:
XMLSerializer.serializeToString()(andNode.toString(),NodeList.toString()) now accept arequireWellFormedoption. When{ requireWellFormed: true }is passed, the serializer throwsInvalidStateErrorfor injection-prone node content, preventing XML injection via attacker-controlled node data.GHSA-j759-j44w-7fr8GHSA-x6wf-f3px-wcqxGHSA-f6ww-3ggp-fr8h- Comment: throws when
datacontains--anywhere, ends with-, or contains characters outside the XMLCharproduction - ProcessingInstruction: throws when target contains
:or matchesxml(case-insensitive), ordatacontains characters outside the XMLCharproduction or contains?> - DocumentType: throws when
publicIdfailsPubidLiteral,systemIdfailsSystemLiteral, orinternalSubsetcontains]>
- Comment: throws when
- Security: DOM traversal operations (
XMLSerializer.serializeToString(),Node.prototype.normalize(),Node.prototype.cloneNode(true),Document.prototype.importNode(node, true),node.textContentgetter,getElementsByTagName()/getElementsByTagNameNS()/getElementsByClassName()/getElementById(),Node.prototype.isEqualNode()) are now iterative. Previously, deeply nested DOM trees would exhaust the JavaScript call stack and throw an unrecoverableRangeError.GHSA-2v35-w6hq-6mfw isEqualNodenow correctly returnsfalsefor CDATASection nodes with differentdata
Deprecated
- The
splitCDATASectionsserializer option is deprecated and will be removed in the next breaking release. The automatic splitting of"]]>"inCDATASectiondata was introduced as a workaround; userequireWellFormed: trueor ensureCDATASectiondata does not contain"]]>"before serialization.
Chore
- updated dependencies
Thank you,
@Jvr2022,
@praveen-kv,
@TharVid,
@decsecre583,
@tlsbollei,
@KarimTantawey,
for your contributions
0.8.13
Fixed
- Security:
XMLSerializer.serializeToString()(andNode.toString(),NodeList.toString()) now accept arequireWellFormedoption (fourth argument, afterisHtmlandnodeFilter). When{ requireWellFormed: true }is passed, the serializer throwsInvalidStateErrorfor injection-prone node content, preventing XML injection via attacker-controlled node data.GHSA-j759-j44w-7fr8GHSA-x6wf-f3px-wcqxGHSA-f6ww-3ggp-fr8h- Comment: throws when
datacontains--> - ProcessingInstruction: throws when
datacontains?> - DocumentType: throws when
publicIdfailsPubidLiteral,systemIdfailsSystemLiteral, orinternalSubsetcontains]>
- Comment: throws when
- Security: DOM traversal operations (
XMLSerializer.serializeToString(),Node.prototype.normalize(),Node.prototype.cloneNode(true),Document.prototype.importNode(node, true),node.textContentgetter,getElementsByTagName()/getElementsByTagNameNS()/getElementsByClassName()/getElementById()) are now iterative. Previously, deeply nested DOM trees would exhaust the JavaScript call stack and throw an unrecoverableRangeError.GHSA-2v35-w6hq-6mfw
Thank you,
@Jvr2022,
@praveen-kv,
@TharVid,
@decsecre583,
@tlsbollei,
@KarimTantawey,
for your contributions
0.9.9
Added
Fixed
- Security:
createCDATASectionnow throwsInvalidCharacterErrorwhendatacontains"]]>", as required by the WHATWG DOM spec.GHSA-wh4c-j3r5-mjhp - Security:
XMLSerializernow splits CDATASection nodes whose data contains"]]>"into adjacent CDATA sections at serialization time, preventing XML injection via mutation methods (appendData,replaceData,.data =,.textContent =).GHSA-wh4c-j3r5-mjhp - correctly traverse ancestor chain in
Node.contains#931
Code that passes a string containing "]]>" to createCDATASection and relied on the previously unsafe behavior will now receive InvalidCharacterError. Use a mutation method such as appendData if you intentionally need "]]>" in a CDATASection node's data.
Chore
- updated dependencies
Thank you,
@stevenobiajulu,
@yoshi389111,
@thesmartshadow,
for your contributions
0.8.12
Fixed
- preserve trailing whitespace in ProcessingInstruction data
#962/#42 - Security:
createCDATASectionnow throwsInvalidCharacterErrorwhendatacontains"]]>", as required by the WHATWG DOM spec.GHSA-wh4c-j3r5-mjhp - Security:
XMLSerializernow splits CDATASection nodes whose data contains"]]>"into adjacent CDATA sections at serialization time, preventing XML injection via mutation methods (appendData,replaceData,.data =,.textContent =).GHSA-wh4c-j3r5-mjhp
Code that passes a string containing "]]>" to createCDATASection and relied on the previously unsafe behavior will now receive InvalidCharacterError. Use a mutation method such as appendData if you intentionally need "]]>" in a CDATASection node's data.
Thank you,
@thesmartshadow,
@stevenobiajulu,
for your contributions
0.8.11
0.9.8
0.9.7
Added
- Implementation of
hasAttributes#804
Fixed
- locator is now true even when other options are being used for the DOMParser
#802/#803 - allow case-insensitive DOCTYPE in HTML
#817/#819
Performance
- simplify
DOM.compareDocumentPosition#805
Chore
- updated devDependencies
Thank you,
@zorkow,
@Ponynjaa,
@WesselKroos,
for your contributions.