aboutsummaryrefslogtreecommitdiff
path: root/archivers/cabextract
diff options
context:
space:
mode:
authorGabor Kovesdan <gabor@FreeBSD.org>2010-07-29 22:45:51 +0000
committerGabor Kovesdan <gabor@FreeBSD.org>2010-07-29 22:45:51 +0000
commitcfdadd1d6c4f4eb06e82f2a25b3cab48d7c5d998 (patch)
treeb36cffa56be99b24e80c7174dcb7053b6ea95e90 /archivers/cabextract
parent6a55fed597b1c0aa82b8e96c9235531a7976d90b (diff)
downloadports-cfdadd1d6c4f4eb06e82f2a25b3cab48d7c5d998.tar.gz
ports-cfdadd1d6c4f4eb06e82f2a25b3cab48d7c5d998.zip
Update to 1.3, which fixes two security bugs. Detailed description
from the author follows. Bug 1: Infinite loop in MS-ZIP decoder [1] The MS-ZIP and Quantum decoders read bits in roughly the same way as the LZX decoder, however they don't have "inject two fake bytes" code. In the situation where read() provides zero bytes, e.g. at the end of file or end of a CAB block, the LZX decoder handles this by injecting two fake bytes, then returns an error on subsequent calls. MS-ZIP and Quantum instead return zero bytes without error. However, all three decoders are written to presume they will get at least one byte. So this could lead to an infinite loop in MS-ZIP and Quantum. An infinite loop has definitely been seen in MS-ZIP - there is a while loop in inflate() of an uncompressed block (block type 0) which won't end until enough input is provided. Partial solution: change "if (read < 0)" to "if (read <= 0)" in mszipd.c and qtmd.c. - http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=90 However, this breaks compatibility with a number of MS-ZIP/Quantum encoded files. A full solution would be to implement the same bit-reading system as LZX. I've done this now, merging all the bit-reading and huffman-reading code into two new files; readbits.h and readhuff.h - http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=95 There are several further changes made to integrate readbits.h and readhuff.h, I recommend you look at the latest version in the source repository. - http://libmspack.svn.sourceforge.net/viewvc/libmspack/libmspack/trunk/mspack/ Bug 2: Segmentation fault in "cabextract -t" This bug may not affect you, depending on your implementation of mspack_system->write(). It does cause a segfault in cabextract's cabx_write() in "-t" (test archive) mode. In the Quantum decoder, when the window wrap is reached, all currently unwritten data is flushed to disk. Sometimes, less data is needed than is flushed, which makes the variable out_bytes negative. When the main decoding loop finishes, a final call to write() is made if out_bytes is not zero. In that situation, it calls mspack_system->write() with a negative byte count, e.g. -129 bytes. You should reject this. In cabextract's "-t" mode, this is not caught, but instead converted to an unsigned integer and passed to md5_process_bytes(), which tries to read e.g. 4294967167 bytes, causing it to read beyond the end of valid process space and thus segfault. Solution: - Break out to the end of the decoding loop immediately if the flush would be more than needed. http://libmspack.svn.sourceforge.net/viewvc/libmspack/libmspack/trunk/mspack/qtmd.c?r1=114&r2=113 - Add checking of the "bytes" argument in mspack_system read() / write() implementations, just to be sure. http://libmspack.svn.sourceforge.net/viewvc/libmspack?view=revision&revision=118 Security: SA40719 [1]
Notes
Notes: svn path=/head/; revision=258453
Diffstat (limited to 'archivers/cabextract')
-rw-r--r--archivers/cabextract/Makefile3
-rw-r--r--archivers/cabextract/distinfo6
2 files changed, 5 insertions, 4 deletions
diff --git a/archivers/cabextract/Makefile b/archivers/cabextract/Makefile
index 69f08af37886..4e062e93b635 100644
--- a/archivers/cabextract/Makefile
+++ b/archivers/cabextract/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= cabextract
-PORTVERSION= 1.2
+PORTVERSION= 1.3
CATEGORIES= archivers
MASTER_SITES= http://www.cabextract.org.uk/
@@ -25,6 +25,7 @@ SRC_DOCS= wince_info wince_rename
PORTDOCS= ${DOCS} ${DOC_DOCS} ${SRC_DOCS}
post-install:
+ ${INSTALL_MAN} ${WRKSRC}/doc/cabextract.1 ${MAN1PREFIX}/man/man1
${INSTALL_MAN} ${WRKSRC}/doc/ja/cabextract.1 ${MAN1PREFIX}/man/ja/man1
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
diff --git a/archivers/cabextract/distinfo b/archivers/cabextract/distinfo
index dd4fbd6cf1bf..fbe29c6547bb 100644
--- a/archivers/cabextract/distinfo
+++ b/archivers/cabextract/distinfo
@@ -1,3 +1,3 @@
-MD5 (cabextract-1.2.tar.gz) = dc421a690648b503265c82ade84e143e
-SHA256 (cabextract-1.2.tar.gz) = ae9c860a74fcea109887b4cf5de8fce575ac14737571520b14b84816f17125eb
-SIZE (cabextract-1.2.tar.gz) = 194006
+MD5 (cabextract-1.3.tar.gz) = cb9a4a38470d2a71a0275968e7eb64d3
+SHA256 (cabextract-1.3.tar.gz) = d464383a35b48d54a3990c02f89acbfc677e655ef46194eae64fb8f433c3c001
+SIZE (cabextract-1.3.tar.gz) = 217633