[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1021647: marked as done (bullseye-pu: package node-xmldom/0.5.0-1+deb11u1)



Your message dated Sat, 17 Dec 2022 10:57:10 +0000
with message-id <03e9b90cf2f149b9e2835590c9ec0ccb048b744d.camel@adam-barratt.org.uk>
and subject line Closing p-u requests for fixes included in 11.6
has caused the Debian Bug report #1021647,
regarding bullseye-pu: package node-xmldom/0.5.0-1+deb11u1
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1021647: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1021647
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian.org@packages.debian.org
Usertags: pu

[ Reason ]
node-xmldom is vulnerable to prototype pollution

[ Impact ]
Medium security issue

[ Tests ]
No new test, curent tests passed with a snapshot update (`jest -u`)

[ Risks ]
Low risk, patch is trivial

[ Checklist ]
  [X] *all* changes are documented in the d/changelog
  [X] I reviewed all changes and I approve them
  [X] attach debdiff against the package in (old)stable
  [X] the issue is verified as fixed in unstable

[ Changes ]
Add checks to avoid prototype pollution. Update also snapshots during
test (`jest -u`)

Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index 41abbd3..e486812 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+node-xmldom (0.5.0-1+deb11u1) bullseye; urgency=medium
+
+  * Team upload
+  * Fix prototype pollution (Closes: #1021618, CVE-2022-37616)
+
+ -- Yadd <yadd@debian.org>  Wed, 12 Oct 2022 09:11:06 +0200
+
 node-xmldom (0.5.0-1) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/CVE-2022-37616.patch b/debian/patches/CVE-2022-37616.patch
new file mode 100644
index 0000000..4bf06b6
--- /dev/null
+++ b/debian/patches/CVE-2022-37616.patch
@@ -0,0 +1,80 @@
+Description: Avoid iterating over prototype properties
+Author: Christian Bewernitz <coder@karfau.de>
+Origin: upstream, https://github.com/xmldom/xmldom/commit/7c0d4b7f
+Bug: https://github.com/xmldom/xmldom/issues/436
+Bug-Debian: https://bugs.debian.org/1021618
+Forwarded: not-needed
+Reviewed-By: Yadd <yadd@debian.org>
+Last-Update: 2022-10-12
+
+--- a/lib/dom.js
++++ b/lib/dom.js
+@@ -1,6 +1,8 @@
+ function copy(src,dest){
+ 	for(var p in src){
++		if (Object.prototype.hasOwnProperty.call(src, p)) {
+ 		dest[p] = src[p];
++		}
+ 	}
+ }
+ /**
+@@ -371,7 +373,7 @@
+     		//console.dir(map)
+     		if(map){
+     			for(var n in map){
+-    				if(map[n] == namespaceURI){
++    				if(Object.prototype.hasOwnProperty.call(map, n) && map[n] == namespaceURI){
+     					return n;
+     				}
+     			}
+@@ -387,7 +389,7 @@
+     		var map = el._nsMap;
+     		//console.dir(map)
+     		if(map){
+-    			if(prefix in map){
++    			if(Object.prototype.hasOwnProperty.call(map, prefix)){
+     				return map[prefix] ;
+     			}
+     		}
+@@ -1170,12 +1172,14 @@
+ function cloneNode(doc,node,deep){
+ 	var node2 = new node.constructor();
+ 	for(var n in node){
++		if (Object.prototype.hasOwnProperty.call(node, n)) {
+ 		var v = node[n];
+ 		if(typeof v != 'object' ){
+ 			if(v != node2[n]){
+ 				node2[n] = v;
+ 			}
+ 		}
++		}
+ 	}
+ 	if(node.childNodes){
+ 		node2.childNodes = new NodeList();
+--- a/lib/sax.js
++++ b/lib/sax.js
+@@ -137,6 +137,7 @@
+ 		        	domBuilder.endElement(config.uri,config.localName,tagName);
+ 					if(localNSMap){
+ 						for(var prefix in localNSMap){
++							if (Object.prototype.hasOwnProperty.call(localNSMap, prefix))
+ 							domBuilder.endPrefixMapping(prefix) ;
+ 						}
+ 					}
+@@ -475,6 +476,7 @@
+ 		domBuilder.endElement(ns,localName,tagName);
+ 		if(localNSMap){
+ 			for(prefix in localNSMap){
++				if (Object.prototype.hasOwnProperty.call(localNSMap, prefix))
+ 				domBuilder.endPrefixMapping(prefix) 
+ 			}
+ 		}
+@@ -522,7 +524,7 @@
+ 	//} 
+ }
+ function _copy(source,target){
+-	for(var n in source){target[n] = source[n]}
++	for(var n in source){if (Object.prototype.hasOwnProperty.call(source, n)) target[n] = source[n]}
+ }
+ function parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'
+ 	var next= source.charAt(start+2)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..8f56e74
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+CVE-2022-37616.patch
diff --git a/debian/tests/pkg-js/test b/debian/tests/pkg-js/test
index 12fbf82..aab41f7 100644
--- a/debian/tests/pkg-js/test
+++ b/debian/tests/pkg-js/test
@@ -1,2 +1,2 @@
 # Text that require xmltest are disabled: xmltest contains a non free file
-jest --ci --testRegex `find test/ -name '*.test.js'|grep -v -f debian/tests/test_exclude`
+jest -u --ci --testRegex `find test/ -name '*.test.js'|grep -v -f debian/tests/test_exclude`

--- End Message ---
--- Begin Message ---
Package: release.debian.org
Version: 11.6

Hi,

Each of the updates referred to in these requests was included in this
morning's 11.6 point release.

Regards,

Adam

--- End Message ---

Reply to: