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

Bug#1040563: marked as done (bookworm-pu: package node-tough-cookie/4.0.0-2+deb12u1)



Your message dated Sat, 22 Jul 2023 13:19:42 +0000
with message-id <E1qNCWM-005rrf-OB@coccia.debian.org>
and subject line Released with 12.1
has caused the Debian Bug report #1040563,
regarding bookworm-pu: package node-tough-cookie/4.0.0-2+deb12u1
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.)


-- 
1040563: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1040563
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bookworm
User: release.debian.org@packages.debian.org
Usertags: pu
X-Debbugs-Cc: node-tough-cookie@packages.debian.org
Control: affects -1 + src:node-tough-cookie

[ Reason ]
node-tough-cookie is vulnerable to prototype pollution

[ Impact ]
Littel security issue

[ Tests ]
Test updated, passed

[ Risks ]
No risk, patch is trivial and tested

[ 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 ]
Create new object instead of using default {}

Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index 3652359..a8e8b7e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+node-tough-cookie (4.0.0-2+deb12u1) bookworm; urgency=medium
+
+  * Team upload
+  * Fix prototype pollution (Closes: CVE-2023-26136)
+
+ -- Yadd <yadd@debian.org>  Fri, 07 Jul 2023 20:57:36 +0400
+
 node-tough-cookie (4.0.0-2) unstable; urgency=medium
 
   * Team upload
diff --git a/debian/patches/CVE-2023-26136.patch b/debian/patches/CVE-2023-26136.patch
new file mode 100644
index 0000000..05e6372
--- /dev/null
+++ b/debian/patches/CVE-2023-26136.patch
@@ -0,0 +1,71 @@
+Description: Fix prototype pollution
+ CVE-2023-26136
+Author: Yadd <yadd@debian.org>
+Forwarded: not-needed
+Last-Update: 2023-07-07
+
+--- a/lib/memstore.js
++++ b/lib/memstore.js
+@@ -39,7 +39,7 @@
+   constructor() {
+     super();
+     this.synchronous = true;
+-    this.idx = {};
++    this.idx = Object.create(null);
+     if (util.inspect.custom) {
+       this[util.inspect.custom] = this.inspect;
+     }
+@@ -109,10 +109,10 @@
+ 
+   putCookie(cookie, cb) {
+     if (!this.idx[cookie.domain]) {
+-      this.idx[cookie.domain] = {};
++      this.idx[cookie.domain] = Object.create(null);
+     }
+     if (!this.idx[cookie.domain][cookie.path]) {
+-      this.idx[cookie.domain][cookie.path] = {};
++      this.idx[cookie.domain][cookie.path] = Object.create(null);
+     }
+     this.idx[cookie.domain][cookie.path][cookie.key] = cookie;
+     cb(null);
+@@ -144,7 +144,7 @@
+     return cb(null);
+   }
+   removeAllCookies(cb) {
+-    this.idx = {};
++    this.idx = Object.create(null);
+     return cb(null);
+   }
+   getAllCookies(cb) {
+--- a/test/cookie_jar_test.js
++++ b/test/cookie_jar_test.js
+@@ -669,4 +669,29 @@
+       }
+     }
+   })
++  .addBatch({
++    "Issue #282 - Prototype pollution": {
++      "when setting a cookie with the domain __proto__": {
++        topic: function() {
++          const jar = new tough.CookieJar(undefined, {
++            rejectPublicSuffixes: false
++          });
++          // try to pollute the prototype
++          jar.setCookieSync(
++            "Slonser=polluted; Domain=__proto__; Path=/notauth",
++            "https://__proto__/admin";
++          );
++          jar.setCookieSync(
++            "Auth=Lol; Domain=google.com; Path=/notauth",
++            "https://google.com/";
++          );
++          this.callback();
++        },
++        "results in a cookie that is not affected by the attempted prototype pollution": function() {
++          const pollutedObject = {};
++          assert(pollutedObject["/notauth"] === undefined);
++        }
++      }
++    }
++  })
+   .export(module);
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..67af372
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+CVE-2023-26136.patch

--- End Message ---
--- Begin Message ---
Version: 12.1

The upload requested in this bug has been released as part of 12.1.

--- End Message ---

Reply to: