Your message dated Sat, 07 Oct 2023 12:41:28 +0100
with message-id 
<84bb5ff8312f749ebe536897993782bf35aa1977.ca...@adam-barratt.org.uk>
and subject line Closing opu requests for updates included in 11.8
has caused the Debian Bug report #1036976,
regarding bullseye-pu: package grunt/1.3.0-1+deb11u2
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 ow...@bugs.debian.org
immediately.)


-- 
1036976: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1036976
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: release.debian.org
Severity: normal
Tags: bullseye
User: release.debian....@packages.debian.org
Usertags: pu
X-Debbugs-Cc: gr...@packages.debian.org
Control: affects -1 + src:grunt

[ Reason ]
file.copy operations in GruntJS are vulnerable to a TOCTOU race condition
leading to arbitrary file write in GitHub repository gruntjs/grunt prior to
1.5.3. This vulnerability is capable of arbitrary file writes which can lead
to local privilege escalation to the GruntJS user if a lower-privileged user
has write access to both source and destination directories as the
lower-privileged user can create a symlink to the GruntJS user's .bashrc
file or replace /etc/shadow file if the GruntJS user is root.

[ Impact ]
Medium security issue

[ Tests ]
Test updated, passed

[ 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 ]
Refuse to copy a file if destination is a symlink

Cheers,
Yadd
diff --git a/debian/changelog b/debian/changelog
index 23c3145..dcebea4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+grunt (1.3.0-1+deb11u2) bullseye; urgency=medium
+
+  * Team upload
+  * Patch up race condition in symlink copying (Closes: CVE-2022-1537)
+
+ -- Yadd <y...@debian.org>  Wed, 31 May 2023 14:59:30 +0400
+
 grunt (1.3.0-1+deb11u1) bullseye; urgency=medium
 
   * Team upload
diff --git a/debian/patches/CVE-2022-1537.patch 
b/debian/patches/CVE-2022-1537.patch
new file mode 100644
index 0000000..19c750b
--- /dev/null
+++ b/debian/patches/CVE-2022-1537.patch
@@ -0,0 +1,39 @@
+Description: Patch up race condition in symlink copying
+Author: Vlad Filippov <vlad.filip...@gmail.com>
+Origin: upstream, https://github.com/gruntjs/grunt/commit/58016ffa
+Bug: https://huntr.dev/bounties/0179c3e5-bc02-4fc9-8491-a1a319b51b4d/
+Forwarded: not-needed
+Applied-Upstream: 1.5.3, commit:58016ffa
+Reviewed-By: Yadd <y...@debian.org>
+Last-Update: 2023-05-31
+
+--- a/lib/grunt/file.js
++++ b/lib/grunt/file.js
+@@ -333,8 +333,8 @@
+     }
+   }
+   // Abort copy if the process function returns false.
+-  if (contents === false) {
+-    grunt.verbose.writeln('Write aborted.');
++  if (contents === false || file.isLink(destpath)) {
++    grunt.verbose.writeln('Write aborted. Either the process function 
returned false or the destination is a symlink');
+   } else {
+     file.write(destpath, contents, readWriteOptions);
+   }
+--- a/test/grunt/file_test.js
++++ b/test/grunt/file_test.js
+@@ -916,5 +916,13 @@
+       test.ok(fs.lstatSync(path.join(destdir.path, 
path.basename(fixtures))).isSymbolicLink());
+       test.done();
+     },
+-  }
++  },
++  'symbolicLinkDestError': function(test) {
++    test.expect(1);
++    var tmpfile = new Tempdir();
++    fs.symlinkSync(path.resolve('test/fixtures/octocat.png'), 
path.join(tmpfile.path, 'octocat.png'), 'file');
++    grunt.file.copy(path.resolve('test/fixtures/octocat.png'), 
path.join(tmpfile.path, 'octocat.png'));
++    test.ok(fs.lstatSync(path.join(tmpfile.path, 
'octocat.png')).isSymbolicLink());
++    test.done();
++  },
+ };
diff --git a/debian/patches/series b/debian/patches/series
index 24fd9f9..6231471 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ add-root-variable.patch
 fix-for-coffescript.diff
 adapt-gruntfile.patch
 CVE-2022-0436.patch
+CVE-2022-1537.patch

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

Hi,

The updates referred to by each of these requests were included in
today's 11.8 bullseye point release.

Regards,

Adam

--- End Message ---

Reply via email to