0.8.13
Security 2
- XMLSerializer.serializeToString() (and Node.toString(), NodeList.toString()) now accept a requireWellFormed option that throws InvalidStateError for injection-prone node content when enabled, preventing XML injection via attacker-controlled node data
- DOM traversal operations (XMLSerializer.serializeToString(), Node.prototype.normalize(), Node.prototype.cloneNode(true), Document.prototype.importNode(node, true), node.textContent getter, getElementsByTagName() / getElementsByTagNameNS() / getElementsByClassName() / getElementById()) 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 (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