From nobody Fri Nov 03 21:24:35 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 4SMYfW57N7z50R7K; Fri, 3 Nov 2023 21:24:35 +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 4SMYfW4jTNz3X85; Fri, 3 Nov 2023 21:24:35 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699046675; 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=UiKreMrNxUk7jYu3+nrObra71m3n1hjNXisDJgX/q7E=; b=IbzmdTbjXokzdJ9rkc6CGujnF/wrE9AXOMF2Kh7ynhcvJzz9fRAAlzA5T8/d9O/qmtMk31 L8wEHnL1bQjHB1qmYlqiRNL6vAcqweh+fqIZiLYF3QmAW5PLmAMdkBF1euxKAhi7GAE0Fp hzcLSLKwMrLn5zYtmy6PqqfnXF61JIbpLtoVH7n9jTxFQpV+y6eur73L5vjuOlmU9UnkBc M0UQvWThBIVdsj547kBoV7+CJUKAbz8rXabBszDkRQLPgV+2nYtokEy+Cizd9hrrNDpz8w yzCpa/ZGb+zrWln9hziqymecL6Ne28AroqDX/BB8+9SFHH2lBCL6PlbNTDh7Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699046675; 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=UiKreMrNxUk7jYu3+nrObra71m3n1hjNXisDJgX/q7E=; b=s01OaCc93GMTJNDRSUVljuuvzyrS9OrRGq+jDNPK+gASTlmaj9Opwt2JuwNI/KQsrGxBPT RVC9YpC/Ns9J/N5i7d7hLW+Kx8U9Rn+2Mfw+Zcv61rXckBzAnMflqohq8hrG/Mwp9/4/FK Gj3V3xfyv0TliIJbmkM0cNo2hDkqMVVY3TwRRn9Rdi0FlOl370Y6w8ctjBhdZYbBxb1siE Y4ru/1a2EQacGm49aK10ZyJxp6q/5TUVyaqky9BpuCmbFIjM2BS2ZDfkDcj84ToFly1f7D /psqsu1CDdhcFZf8KjjWAh1f57dA4wXXfmNYo3CUWJIdbSz5f8O93yJVnuO7Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699046675; a=rsa-sha256; cv=none; b=NlFPxZdDHJQ01PLTs7otKcl/NgCGQecrSB3YjxDuNuE5GrNJO4wCkuxsjzXDUphnwktYFp uO9oDtuCkod7U2gH8UlO0JKlhU3KN585wUmfT03yLgy9wa03kno8DZElCGWYFXsE0NGyot 6K5op5IvSFuodw/SpIDbgzzbIORyQI2fPhrhJKTSv4qijZbsJOGXrWm2QuBYduuuDDkcrP F4u8FHcA83QO7seqGnlaK8DQrXN2CafuguMSWzGHy5QNBy/O7eKDi/utp0KoR4CDdwfjQu dU+EmN7eocAfMFvF0xiJq0I2XXsL0UYEn31hPpx6rHOWQxzN5gaD5rfWrEhLYQ== 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 4SMYfW3pqlzWjB; Fri, 3 Nov 2023 21:24:35 +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 3A3LOZcr015391; Fri, 3 Nov 2023 21:24:35 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A3LOZPo015388; Fri, 3 Nov 2023 21:24:35 GMT (envelope-from git) Date: Fri, 3 Nov 2023 21:24:35 GMT Message-Id: <202311032124.3A3LOZPo015388@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-branches@FreeBSD.org From: Robert Clausecker Subject: git: 0ce6caa1ea71 - 2023Q4 - 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/2023Q4 X-Git-Reftype: branch X-Git-Commit: 0ce6caa1ea714ad0ff196f909713648193d8d3ba Auto-Submitted: auto-generated The branch 2023Q4 has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=0ce6caa1ea714ad0ff196f909713648193d8d3ba commit 0ce6caa1ea714ad0ff196f909713648193d8d3ba Author: Thomas Hurst AuthorDate: 2023-10-30 22:45:22 +0000 Commit: Robert Clausecker CommitDate: 2023-11-03 21:20:01 +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 (cherry picked from commit 0a1052798c8e4879ca869b9032830a4ca00b1c02) --- 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;