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

Bug#1008163: marked as done (buster-pu: package node-minimist/1.2.0-1+deb10u2)



Your message dated Sat, 10 Sep 2022 13:40:55 +0100
with message-id <2cfc9645343bdb910fe19c07bddfec2c428346a3.camel@adam-barratt.org.uk>
and subject line Closing requests for updates included in 10.13
has caused the Debian Bug report #1008163,
regarding buster-pu: package node-minimist/1.2.0-1+deb10u2
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.)


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

[ Reason ]
node-minimist is vulnerable to a prototype pollution not totally fixed
by CVE-2020-7598 patch (pushed in 1.2.5-1 and 1.2.0-1+deb10u1)

[ Impact ]
Medium vulnerability

[ Tests ]
Test updated by upstream, passed localy (sadly not enabled in buster)

[ 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 ]
Better object check

Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index 327fcb5..5d1f9d5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+node-minimist (1.2.0-1+deb10u2) buster; urgency=medium
+
+  * Fix prototype pollution (Closes: CVE-2021-44906)
+
+ -- Yadd <yadd@debian.org>  Wed, 23 Mar 2022 12:42:36 +0100
+
 node-minimist (1.2.0-1+deb10u1) buster; urgency=medium
 
   * Team upload
diff --git a/debian/patches/CVE-2021-44906.patch b/debian/patches/CVE-2021-44906.patch
new file mode 100644
index 0000000..8f26607
--- /dev/null
+++ b/debian/patches/CVE-2021-44906.patch
@@ -0,0 +1,59 @@
+Description: Fix for prototype pollution
+ The initial fix for prototype pollution (cf. SNYK-JS-MINIMIST-559764) in
+ setKey() was insufficient.
+Author: Yadd <yadd@debian.org>
+Origin: upstream, https://github.com/substack/minimist/pull/165
+Bug: https://github.com/substack/minimist/issues/164
+Forwarded: not-needed
+Last-Update: 2022-03-23
+
+--- a/index.js
++++ b/index.js
+@@ -70,7 +70,7 @@
+         var o = obj;
+         for (var i = 0; i < keys.length-1; i++) {
+             var key = keys[i];
+-            if (key === '__proto__') return;
++            if (isConstructorOrProto(o, key)) return;
+             if (o[key] === undefined) o[key] = {};
+             if (o[key] === Object.prototype || o[key] === Number.prototype
+                 || o[key] === String.prototype) o[key] = {};
+@@ -79,7 +79,7 @@
+         }
+ 
+         var key = keys[keys.length - 1];
+-        if (key === '__proto__') return;
++        if (isConstructorOrProto(o, key)) return;
+         if (o === Object.prototype || o === Number.prototype
+             || o === String.prototype) o = {};
+         if (o === Array.prototype) o = [];
+@@ -243,3 +243,7 @@
+     return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
+ }
+ 
++
++function isConstructorOrProto (obj, key) {
++    return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__';
++}
+--- a/test/parse.js
++++ b/test/parse.js
+@@ -195,3 +195,19 @@
+     t.same(argv.beep, { boop : true });
+     t.end();
+ });
++
++test('proto pollution (constructor function)', function (t) {
++    var argv = parse(['--_.concat.constructor.prototype.y', '123']);
++    function fnToBeTested() {}
++    t.equal(fnToBeTested.y, undefined);
++    t.equal(argv.y, undefined);
++    t.end();
++});
++
++// powered by snyk - https://github.com/backstage/backstage/issues/10343
++test('proto pollution (constructor function) snyk', function (t) {
++    var argv = parse('--_.constructor.constructor.prototype.foo bar'.split(' '));
++    t.equal((function(){}).foo, undefined);
++    t.equal(argv.y, undefined);
++    t.end();
++})
diff --git a/debian/patches/series b/debian/patches/series
index 01db0e3..71e31e0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 nodejs.patch
 CVE-2020-7598.diff
+CVE-2021-44906.patch

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

Hi,

Each of the updates referenced in these bugs was included in today's
10.13 point release.

Regards,

Adam

--- End Message ---

Reply to: