From nobody Fri Nov 3 21:18:12 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SMYW94JcBz50QNp; Fri, 3 Nov 2023 21:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SMYW91DQ9z3SpV; Fri, 3 Nov 2023 21:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699046293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zU4VI9gBUC4CT70LqxBn8vScd23trEIfNlk6khV+s5A=; b=vpPsldDlks64ivAYM0YFDw++cYa/m4xcHI26FVM/0uIGb8C80r1F+ciNIest3Ee1M3lYoS U5JRPPskuS6RGpS659QhYnDAP8tg7QMZVwMQecTQNSQvwo/KVuXU09x6ahm63029z79TmG sV2NylE5dGkPD2NsocvK6bZXoaMphOiDm3M9pHqngpJ1fyd493y5rl8bc/xdWlsaY1YrHn EK6g17wmGai1NdsdRH3TAWPymTgQl+i1Xbs+7RjFNUk6vU7QGWxPuVBNv3nl5RJwn1Gs2W Hii8pFjI/3O04aWr9Q1ABYm5pKgUFlaOWMksmzVNzEjmFFbwn6my7es7BFZQbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699046293; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zU4VI9gBUC4CT70LqxBn8vScd23trEIfNlk6khV+s5A=; b=bw+trkrjaAOrVldc0WvV+1KpmiNVXCC0aoejGoVwASStZKxR3OV+DxkKPOmK+IJamWCUTL s/U1CTGy0CvQJDzWtswUH2HYH8eZzsAt1shGiIOnDzVAelfNJQi/GjP6jaqA76/IvlOqaQ 9jMj3f4KXvjtS2wFlHWwH/b4PHqXB/QzHG9S9N2FMUR+fn/8mBP+JNZodm081bH/zTVqkZ HH9THEWxCO/Rw7Q5TREceTwMUU2DptiV3LHbPzSFox6o3+XJDRn6YegWWn/EA8aDtauyeM nCCw6rsgQ3237hF9V2GMpzgzxtolzfrfHkbD/jt9kRcpxhBMpFk3LgygtR9VFg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699046293; a=rsa-sha256; cv=none; b=G7Q+zD5wPes0VX09FCRL0C2/QPOfd2QyKR3/VnEzLjiQTq01SjMT6c4Px08ITvvQmw+BoP zQ5FgX3wpOHKccs/32cPrxK5bZklJKq18iM6CumYdLUpOsXMX9S1iLRg4Gc4PvMnGuPVSQ LTLNe/mCpXge2Xj0aoEj1OE69UgkaPX+b/Y0bNAAJtkUlrvzJSTxQDYc9g/8iRYOReEyHw swK5JKkFZ4JcbJ4kY3tbnP+TuJxHahPLVcWcsDtIazGI8l5yVwGtN6KW9yoPEYYpS4t9pw FvAkP236AAByYZ2msfHqcn7XL/scpKCfhqc8m1YVRW6bJMX88vCh+CazbaLUhQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SMYW90L0SzWSg; Fri, 3 Nov 2023 21:18:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3A3LICRx098699; Fri, 3 Nov 2023 21:18:12 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A3LICDC098696; Fri, 3 Nov 2023 21:18:12 GMT (envelope-from git) Date: Fri, 3 Nov 2023 21:18:12 GMT Message-Id: <202311032118.3A3LICDC098696@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Robert Clausecker Subject: git: 0a1052798c8e - main - graphics/optipng: Add fix for CVE-2023-43907 List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fuz X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0a1052798c8e4879ca869b9032830a4ca00b1c02 Auto-Submitted: auto-generated The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=0a1052798c8e4879ca869b9032830a4ca00b1c02 commit 0a1052798c8e4879ca869b9032830a4ca00b1c02 Author: Thomas Hurst AuthorDate: 2023-10-30 22:45:22 +0000 Commit: Robert Clausecker CommitDate: 2023-11-03 21:16:19 +0000 graphics/optipng: Add fix for CVE-2023-43907 - Add a bounds check to prevent out-of-bounds read of buffer on specially-formed GIF files. - Remove BUNDLED_LIBPNG and BUNDLED_ZLIB, as the supplied versions are well out of date and offer no noted advantages. PR: 274822 MFH: 2023Q4 Security: fe7ac70a-792b-11ee-bf9a-a04a5edf46d9 --- graphics/optipng/Makefile | 28 ++++++++++------------ graphics/optipng/files/patch-src_gifread_gifread.c | 14 +++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/graphics/optipng/Makefile b/graphics/optipng/Makefile index adf3fcdb59be..acbe6053199d 100644 --- a/graphics/optipng/Makefile +++ b/graphics/optipng/Makefile @@ -1,36 +1,32 @@ PORTNAME= optipng -PORTVERSION= 0.7.7 +DISTVERSION= 0.7.7 +PORTREVISION= 1 CATEGORIES= graphics MASTER_SITES= SF/${PORTNAME}/OptiPNG/${PORTNAME}-${PORTVERSION} MAINTAINER= tom@hur.st COMMENT= Optimizer for PNG files -WWW= http://optipng.sourceforge.net/ +WWW= https://optipng.sourceforge.net/ LICENSE= ZLIB LICENSE_FILE= ${WRKSRC}/LICENSE.txt -OPTIONS_DEFINE= BUNDLED_LIBPNG BUNDLED_ZLIB DOCS +LIB_DEPENDS= libpng.so:graphics/png -BUNDLED_LIBPNG_DESC= Use bundled libpng -BUNDLED_LIBPNG_CONFIGURE_OFF= --with-system-libpng -BUNDLED_LIBPNG_CONFIGURE_ON= --without-system-libpng -BUNDLED_LIBPNG_LIB_DEPENDS_OFF= libpng.so:graphics/png -BUNDLED_LIBPNG_USES_OFF= localbase:ldflags - -BUNDLED_ZLIB_DESC= Use bundled zlib -BUNDLED_ZLIB_CONFIGURE_OFF= --with-system-zlib -BUNDLED_ZLIB_CONFIGURE_ON= --without-system-zlib +USES= cpe gmake localbase:ldflags +CPE_VENDOR= optipng_project -USES= cpe gmake HAS_CONFIGURE= yes +CONFIGURE_ARGS= --with-system-libpng \ + --with-system-zlib -CPE_VENDOR= optipng_project - -PLIST_FILES= bin/optipng man/man1/optipng.1.gz +PLIST_FILES= bin/optipng \ + man/man1/optipng.1.gz PORTDOCS= history.txt optipng.man.html optipng.man.pdf optipng.man.txt \ png_optimization.html todo.txt +OPTIONS_DEFINE= DOCS + do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/optipng/optipng ${STAGEDIR}${PREFIX}/bin/ ${INSTALL_MAN} ${WRKSRC}/src/optipng/man/optipng.1 ${STAGEDIR}${MAN1PREFIX}/man/man1/ diff --git a/graphics/optipng/files/patch-src_gifread_gifread.c b/graphics/optipng/files/patch-src_gifread_gifread.c new file mode 100644 index 000000000000..bfc0112026c5 --- /dev/null +++ b/graphics/optipng/files/patch-src_gifread_gifread.c @@ -0,0 +1,14 @@ +--- src/gifread/gifread.c.orig 2017-12-10 23:49:00 UTC ++++ src/gifread/gifread.c +@@ -363,6 +363,11 @@ static int LZWGetCode(int code_size, int init_flag, FI + lastbit = (2 + count) * 8; + } + ++ if (code_size && (size_t)(curbit + code_size - 1) / 8 >= sizeof(buffer)) { ++ GIFError("Malformed GIF (CVE-2023-43907)"); ++ return -1; ++ } ++ + ret = 0; + for (i = curbit, j = 0; j < code_size; ++i, ++j) + ret |= ((buffer[i / 8] & (1 << (i % 8))) != 0) << j;