Wed Jul 11 09:07:21 2012 UTC ()
CVE-2012-3358:
A heap-based buffer overflow was found in the way OpenJPEG, an
open-source JPEG 2000 codec written in C language, performed parsing of
JPEG2000 having certain number of tiles and tilesizes. A remote
attacker could provide a specially crafted JPEG 2000 file, which when
opened in an application linked against openjpeg would lead to that
application crash, or, potentially arbitrary code execution with the
privileges of the user running the application.
http://code.google.com/p/openjpeg/source/detail?r=1727
Bump PKGREVISION.
pkglint cleanups while here.
(wiz)
diff -r1.1.1.1 -r1.2 pkgsrc/graphics/openjpeg/DESCR
diff -r1.2 -r1.3 pkgsrc/graphics/openjpeg/Makefile
diff -r1.2 -r1.3 pkgsrc/graphics/openjpeg/distinfo
diff -r0 -r1.1 pkgsrc/graphics/openjpeg/patches/patch-libopenjpeg_j2k.c
--- pkgsrc/graphics/openjpeg/DESCR 2010/09/09 02:15:22 1.1.1.1
+++ pkgsrc/graphics/openjpeg/DESCR 2012/07/11 09:07:21 1.2
| @@ -1,3 +1,3 @@ | | | @@ -1,3 +1,3 @@ |
1 | The OpenJPEG library is an open-source JPEG 2000 codec written in C. It | | 1 | The OpenJPEG library is an open-source JPEG 2000 codec written in C. It |
2 | has been developed in order to promote the use of JPEG 2000 and is | | 2 | has been developed in order to promote the use of JPEG 2000 and is |
3 | licensed under a BSD license. | | 3 | licensed under a BSD license. |
--- pkgsrc/graphics/openjpeg/Makefile 2012/03/24 13:25:00 1.2
+++ pkgsrc/graphics/openjpeg/Makefile 2012/07/11 09:07:21 1.3
| @@ -1,21 +1,22 @@ | | | @@ -1,21 +1,22 @@ |
1 | # $NetBSD: Makefile,v 1.2 2012/03/24 13:25:00 drochner Exp $ | | 1 | # $NetBSD: Makefile,v 1.3 2012/07/11 09:07:21 wiz Exp $ |
2 | # | | 2 | # |
3 | | | 3 | |
4 | DISTNAME= openjpeg-1.5.0 | | 4 | DISTNAME= openjpeg-1.5.0 |
| | | 5 | PKGREVISION= 1 |
5 | CATEGORIES= graphics | | 6 | CATEGORIES= graphics |
6 | MASTER_SITES= http://openjpeg.googlecode.com/files/ | | 7 | MASTER_SITES= http://openjpeg.googlecode.com/files/ |
7 | | | 8 | |
8 | MAINTAINER= pkgsrc-users@NetBSD.org | | 9 | MAINTAINER= pkgsrc-users@NetBSD.org |
9 | HOMEPAGE= http://www.openjpeg.org/ | | 10 | HOMEPAGE= http://www.openjpeg.org/ |
10 | COMMENT= JPEG 2000 library | | 11 | COMMENT= JPEG 2000 library |
| | | 12 | LICENSE= 2-clause-bsd |
11 | | | 13 | |
12 | PKG_DESTDIR_SUPPORT= user-destdir | | 14 | PKG_DESTDIR_SUPPORT= user-destdir |
13 | LICENSE= 2-clause-bsd | | | |
14 | | | 15 | |
15 | GNU_CONFIGURE= yes | | 16 | GNU_CONFIGURE= yes |
16 | CONFIGURE_ARGS+= --disable-doc | | 17 | CONFIGURE_ARGS+= --disable-doc |
17 | USE_LIBTOOL= yes | | 18 | USE_LIBTOOL= yes |
18 | | | 19 | |
19 | CFLAGS+= -DHAVE_POSIX_MEMALIGN | | 20 | CFLAGS+= -DHAVE_POSIX_MEMALIGN |
20 | | | 21 | |
21 | .include "../../mk/bsd.pkg.mk" | | 22 | .include "../../mk/bsd.pkg.mk" |
--- pkgsrc/graphics/openjpeg/distinfo 2012/03/24 13:25:01 1.2
+++ pkgsrc/graphics/openjpeg/distinfo 2012/07/11 09:07:21 1.3
| @@ -1,6 +1,7 @@ | | | @@ -1,6 +1,7 @@ |
1 | $NetBSD: distinfo,v 1.2 2012/03/24 13:25:01 drochner Exp $ | | 1 | $NetBSD: distinfo,v 1.3 2012/07/11 09:07:21 wiz Exp $ |
2 | | | 2 | |
3 | SHA1 (openjpeg-1.5.0.tar.gz) = dce705ae45f137e4698a8cf39d1fbf22bc434fa8 | | 3 | SHA1 (openjpeg-1.5.0.tar.gz) = dce705ae45f137e4698a8cf39d1fbf22bc434fa8 |
4 | RMD160 (openjpeg-1.5.0.tar.gz) = ffa85dbb0a3ba1545bc6974f4950f466789c04ef | | 4 | RMD160 (openjpeg-1.5.0.tar.gz) = ffa85dbb0a3ba1545bc6974f4950f466789c04ef |
5 | Size (openjpeg-1.5.0.tar.gz) = 2117572 bytes | | 5 | Size (openjpeg-1.5.0.tar.gz) = 2117572 bytes |
6 | SHA1 (patch-aa) = 503b565958dc74a17b68f968a44c5c861d84b343 | | 6 | SHA1 (patch-aa) = 503b565958dc74a17b68f968a44c5c861d84b343 |
| | | 7 | SHA1 (patch-libopenjpeg_j2k.c) = 3ea7816b479dbba7822d20b187a6916e4d882e37 |
$NetBSD: patch-libopenjpeg_j2k.c,v 1.1 2012/07/11 09:07:21 wiz Exp $
CVE-2012-3358:
A heap-based buffer overflow was found in the way OpenJPEG, an
open-source JPEG 2000 codec written in C language, performed parsing of
JPEG2000 having certain number of tiles and tilesizes. A remote
attacker could provide a specially crafted JPEG 2000 file, which when
opened in an application linked against openjpeg would lead to that
application crash, or, potentially arbitrary code execution with the
privileges of the user running the application.
http://code.google.com/p/openjpeg/source/detail?r=1727
--- libopenjpeg/j2k.c.orig 2012-02-07 10:49:55.000000000 +0000
+++ libopenjpeg/j2k.c
@@ -1269,7 +1269,7 @@ static void j2k_read_sot(opj_j2k_t *j2k)
static int backup_tileno = 0;
/* tileno is negative or larger than the number of tiles!!! */
- if ((tileno < 0) || (tileno > (cp->tw * cp->th))) {
+ if ((tileno < 0) || (tileno >= (cp->tw * cp->th))) {
opj_event_msg(j2k->cinfo, EVT_ERROR,
"JPWL: bad tile number (%d out of a maximum of %d)\n",
tileno, (cp->tw * cp->th));
@@ -1286,8 +1286,18 @@ static void j2k_read_sot(opj_j2k_t *j2k)
/* keep your private count of tiles */
backup_tileno++;
- };
+ }
+ else
#endif /* USE_JPWL */
+ {
+ /* tileno is negative or larger than the number of tiles!!! */
+ if ((tileno < 0) || (tileno >= (cp->tw * cp->th))) {
+ opj_event_msg(j2k->cinfo, EVT_ERROR,
+ "JPWL: bad tile number (%d out of a maximum of %d)\n",
+ tileno, (cp->tw * cp->th));
+ return;
+ }
+ }
if (cp->tileno_size == 0) {
cp->tileno[cp->tileno_size] = tileno;
@@ -1325,8 +1335,18 @@ static void j2k_read_sot(opj_j2k_t *j2k)
totlen);
}
- };
+ }
+ else
#endif /* USE_JPWL */
+ {
+ /* totlen is negative or larger than the bytes left!!! */
+ if ((totlen < 0) || (totlen > (cio_numbytesleft(cio) + 8))) {
+ opj_event_msg(j2k->cinfo, EVT_ERROR,
+ "JPWL: bad tile byte size (%d bytes against %d bytes left)\n",
+ totlen, cio_numbytesleft(cio) + 8);
+ return;
+ }
+ }
if (!totlen)
totlen = cio_numbytesleft(cio) + 8;