0.9.10
Fixed 1
- isEqualNode now correctly returns false for CDATASection nodes with different data
Deprecated 1
- The splitCDATASections serializer option is deprecated and will be removed in the next breaking release
Security 2
- XMLSerializer.serializeToString() (and Node.toString(), NodeList.toString()) now accept a requireWellFormed option that throws InvalidStateError for injection-prone node content when enabled
- DOM traversal operations (XMLSerializer.serializeToString(), Node.prototype.normalize(), Node.prototype.cloneNode(true), Document.prototype.importNode(node, true), node.textContent getter, getElementsByTagName() / getElementsByTagNameNS() / getElementsByClassName() / getElementById(), Node.prototype.isEqualNode()) are now iterative to prevent stack exhaustion on deeply nested DOM trees
From xmldom
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