summaryrefslogtreecommitdiff
path: root/user/minizip
diff options
context:
space:
mode:
Diffstat (limited to 'user/minizip')
-rw-r--r--user/minizip/APKBUILD38
-rw-r--r--user/minizip/CVE-2023-45853.patch40
2 files changed, 78 insertions, 0 deletions
diff --git a/user/minizip/APKBUILD b/user/minizip/APKBUILD
new file mode 100644
index 000000000..b7de2ee8b
--- /dev/null
+++ b/user/minizip/APKBUILD
@@ -0,0 +1,38 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=minizip
+pkgver=1.3
+pkgrel=0
+pkgdesc="Miniature ZIP archive manipulation library"
+url="https://zlib.net"
+arch="all"
+license="zlib"
+depends=""
+makedepends="autoconf automake libtool zlib-dev"
+subpackages="$pkgname-dev"
+source="https://zlib.net/zlib-$pkgver.tar.gz
+ CVE-2023-45853.patch
+ "
+builddir="$srcdir"/zlib-$pkgver/contrib/minizip
+
+prepare() {
+ default_prepare
+ autoreconf -vif
+}
+
+build() {
+ ./configure \
+ --prefix=/usr \
+ --enable-shared
+ make
+}
+
+check() {
+ make check
+}
+
+package() {
+ make DESTDIR="$pkgdir" install
+}
+sha512sums="185795044461cd78a5545250e06f6efdb0556e8d1bfe44e657b509dd6f00ba8892c8eb3febe65f79ee0b192d6af857f0e0055326d33a881449f3833f92e5f8fb zlib-1.3.tar.gz
+06bb69fe70c3ad7b11e0cf43ff4f7e631010ccc9d74e736d2106d6bf7b4b0934da7c695011757b57511d176a2cf0b4955b854bb8e78a196abcf2792c40e9cea1 CVE-2023-45853.patch"
diff --git a/user/minizip/CVE-2023-45853.patch b/user/minizip/CVE-2023-45853.patch
new file mode 100644
index 000000000..66dfd5707
--- /dev/null
+++ b/user/minizip/CVE-2023-45853.patch
@@ -0,0 +1,40 @@
+This patch differs from upstream in the following way(s):
+
+* Paths changed to accommodate 'builddir'
+
+From 73331a6a0481067628f065ffe87bb1d8f787d10c Mon Sep 17 00:00:00 2001
+From: Hans Wennborg <hans@chromium.org>
+Date: Fri, 18 Aug 2023 11:05:33 +0200
+Subject: [PATCH] Reject overflows of zip header fields in minizip.
+
+This checks the lengths of the file name, extra field, and comment
+that would be put in the zip headers, and rejects them if they are
+too long. They are each limited to 65535 bytes in length by the zip
+format. This also avoids possible buffer overflows if the provided
+fields are too long.
+---
+ contrib/minizip/zip.c | 11 +++++++++++
+ 1 file changed, 11 insertions(+)
+
+diff --git a/contrib/minizip/zip.c b/contrib/minizip/zip.c
+index 3d3d4cadd..0446109b2 100644
+--- a/zip.c
++++ b/zip.c
+@@ -1043,6 +1043,17 @@ extern int ZEXPORT zipOpenNewFileInZip4_64(zipFile file, const char* filename, c
+ return ZIP_PARAMERROR;
+ #endif
+
++ // The filename and comment length must fit in 16 bits.
++ if ((filename!=NULL) && (strlen(filename)>0xffff))
++ return ZIP_PARAMERROR;
++ if ((comment!=NULL) && (strlen(comment)>0xffff))
++ return ZIP_PARAMERROR;
++ // The extra field length must fit in 16 bits. If the member also requires
++ // a Zip64 extra block, that will also need to fit within that 16-bit
++ // length, but that will be checked for later.
++ if ((size_extrafield_local>0xffff) || (size_extrafield_global>0xffff))
++ return ZIP_PARAMERROR;
++
+ zi = (zip64_internal*)file;
+
+ if (zi->in_opened_file_inzip == 1)