guix-commits
[Top][All Lists]
Advanced

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

branch master updated: gnu: ytnef: Fix CVE-2021-3403 and CVE-2021-3404.


From: guix-commits
Subject: branch master updated: gnu: ytnef: Fix CVE-2021-3403 and CVE-2021-3404.
Date: Fri, 05 Mar 2021 22:51:14 -0500

This is an automated email from the git hooks/post-receive script.

lle_bout pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 090456d  gnu: ytnef: Fix CVE-2021-3403 and CVE-2021-3404.
090456d is described below

commit 090456dacb76160280a630d53f4f47b421281c66
Author: Léo Le Bouter <lle-bout@zaclys.net>
AuthorDate: Sat Mar 6 04:47:10 2021 +0100

    gnu: ytnef: Fix CVE-2021-3403 and CVE-2021-3404.
    
    * gnu/packages/patches/ytnef-CVE-2021-3403.patch,
    gnu/packages/patches/ytnef-CVE-2021-3404.patch: New patches.
    * gnu/local.mk (dist_patch_DATA): Register them.
    * gnu/packages/mail.scm (ytnef): Apply them.
---
 gnu/local.mk                                   |  2 ++
 gnu/packages/mail.scm                          |  4 +++-
 gnu/packages/patches/ytnef-CVE-2021-3403.patch | 32 ++++++++++++++++++++++++++
 gnu/packages/patches/ytnef-CVE-2021-3404.patch | 30 ++++++++++++++++++++++++
 4 files changed, 67 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index 4900dab..fb3b395 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1755,6 +1755,8 @@ dist_patch_DATA =                                         
\
   %D%/packages/patches/xsane-support-ipv6.patch                        \
   %D%/packages/patches/xsane-tighten-default-umask.patch       \
   %D%/packages/patches/yggdrasil-extra-config.patch    \
+  %D%/packages/patches/ytnef-CVE-2021-3403.patch       \
+  %D%/packages/patches/ytnef-CVE-2021-3404.patch       \
   %D%/packages/patches/zziplib-CVE-2018-16548.patch
 
 MISC_DISTRO_FILES =                            \
diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm
index 0e0934a..d90bfea 100644
--- a/gnu/packages/mail.scm
+++ b/gnu/packages/mail.scm
@@ -3909,7 +3909,9 @@ It is a replacement for the @command{urlview} program.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "07h48s5qf08503pp9kafqbwipdqghiif22ghki7z8j67gyp04l6l"))))
+                "07h48s5qf08503pp9kafqbwipdqghiif22ghki7z8j67gyp04l6l"))
+              (patches (search-patches "ytnef-CVE-2021-3403.patch"
+                                       "ytnef-CVE-2021-3404.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("autoconf" ,autoconf)
diff --git a/gnu/packages/patches/ytnef-CVE-2021-3403.patch 
b/gnu/packages/patches/ytnef-CVE-2021-3403.patch
new file mode 100644
index 0000000..4b1c9d6
--- /dev/null
+++ b/gnu/packages/patches/ytnef-CVE-2021-3403.patch
@@ -0,0 +1,32 @@
+From f2380a53fb84d370eaf6e6c3473062c54c57fac7 Mon Sep 17 00:00:00 2001
+From: Oliver Giles <ohw.giles@gmail.com>
+Date: Mon, 1 Feb 2021 10:12:16 +1300
+Subject: [PATCH] Prevent potential double-free in TNEFSubjectHandler
+
+If TNEFSubjectHandler is called multiple times, but the last time
+failed due to the PREALLOCCHECK, the subject.data member will be
+a freed, but invalid pointer. To prevent a double-free next time
+TNEFSubjectHandler is entered, set it to zero after freeing.
+
+Resolves: #85
+Reported-by: jasperla
+---
+ lib/ytnef.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/ytnef.c b/lib/ytnef.c
+index b148719..b06c807 100644
+--- a/lib/ytnef.c
++++ b/lib/ytnef.c
+@@ -301,8 +301,10 @@ int TNEFFromHandler STD_ARGLIST {
+ }
+ // 
-----------------------------------------------------------------------------
+ int TNEFSubjectHandler STD_ARGLIST {
+-  if (TNEF->subject.data)
++  if (TNEF->subject.data) {
+     free(TNEF->subject.data);
++    TNEF->subject.data = NULL;
++  }
+ 
+   PREALLOCCHECK(size, 100);
+   TNEF->subject.data = calloc(size+1, sizeof(BYTE));
diff --git a/gnu/packages/patches/ytnef-CVE-2021-3404.patch 
b/gnu/packages/patches/ytnef-CVE-2021-3404.patch
new file mode 100644
index 0000000..e991d6a
--- /dev/null
+++ b/gnu/packages/patches/ytnef-CVE-2021-3404.patch
@@ -0,0 +1,30 @@
+From f9ff4a203b8c155d51a208cadadb62f224fba715 Mon Sep 17 00:00:00 2001
+From: Oliver Giles <ohw.giles@gmail.com>
+Date: Mon, 1 Feb 2021 10:18:17 +1300
+Subject: [PATCH] Ensure the size of the version field is 4 bytes
+
+A corrupted version field size can cause TNEFVersion to access outside
+of allocated memory. Check the version is the expected size and raise
+an error if not.
+
+Resolves: #86
+Reported-by: jasperla
+---
+ lib/ytnef.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/ytnef.c b/lib/ytnef.c
+index b148719..ffede44 100644
+--- a/lib/ytnef.c
++++ b/lib/ytnef.c
+@@ -335,6 +335,10 @@ int TNEFRendData STD_ARGLIST {
+ int TNEFVersion STD_ARGLIST {
+   WORD major;
+   WORD minor;
++  if (size != 2 * sizeof(WORD)) {
++    printf("Incorrect size of version field, suspected corruption\n");
++    return -1;
++  }
+   minor = SwapWord((BYTE*)data, size);
+   major = SwapWord((BYTE*)data + 2, size - 2);
+ 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]