We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4490b40 + 9666461 commit 49c2e06Copy full SHA for 49c2e06
dom-element.js
@@ -128,7 +128,10 @@ DOMElement.prototype.getAttributeNS =
128
129
DOMElement.prototype.removeAttributeNS =
130
function _Element_removeAttributeNS(namespace, name) {
131
- // Safely access and delete the attribute
+ // Prevent prototype pollution by checking if namespace is a direct property
132
+ if (!Object.prototype.hasOwnProperty.call(this._attributes, namespace)) {
133
+ return;
134
+ }
135
var attributes = this._attributes[namespace];
136
if (attributes && Object.prototype.hasOwnProperty.call(attributes, name)) {
137
delete attributes[name];
0 commit comments