Sourced from @xmldom/xmldom's
releases.
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]>- 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-6mfwThank you,
@Jvr2022,@praveen-kv,@TharVid,@decsecre583,@tlsbollei,@KarimTantawey, for your contributions
Sourced from @xmldom/xmldom's
changelog.
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]>- 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-6mfwThank you,
@Jvr2022,@praveen-kv,@TharVid,@decsecre583,@tlsbollei,@KarimTantawey, for your contributions0.9.9
Added
- implement
ParentNode.childrengetter[#960](https://github.com/xmldom/xmldom/issues/960)/[#410](https://github.com/xmldom/xmldom/issues/410)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](https://github.com/xmldom/xmldom/issues/931)Code that passes a string containing
"]]>"tocreateCDATASectionand relied on the previously unsafe behavior will now receiveInvalidCharacterError. Use a mutation method such asappendDataif you intentionally need"]]>"in a CDATASection node's data.Chore
- updated dependencies
Thank you,
@stevenobiajulu,@yoshi389111,@thesmartshadow, for your contributions
e5c1480
0.8.139611e20
style: drop unused import in test filedc4dff3
docs: add 0.8.13 changelog entry842fa38
fix: prevent stack overflow in normalize (GHSA-2v35-w6hq-6mfw)aeff69f
test: add normalize behavioral coverage to node.test.jscbdb0d7
fix: make walkDOM iterative to prevent stack overflow
(GHSA-2v35-w6hq-6mfw)0b543d3
test: assert namespace declarations are isolated between siblings in
serializ...c007c51
refactor: migrate serializeToString to walkDOM2bb3899
test: add serializeToString coverage for uncovered branchese69f38d
refactor: migrate importNode to walkDOMThis version was pushed to npm by karfau, a new releaser for
@xmldom/xmldom since your current version.