Merge pull request #73586 from c0bw3b/sec/jasper

jasper: mark as vulnerable, replace with openjpeg where possible, disable JPEG2000 support.
This commit is contained in:
Christian Kauhaus 2019-11-24 13:15:02 +01:00 committed by GitHub
commit f02d65c980
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 62 additions and 28 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, gdal, wxGTK30, proj, libiodbc, lzma, jasper, { stdenv, fetchurl, gdal, wxGTK30, proj, libiodbc, lzma,
libharu, opencv, vigra, postgresql, Cocoa, libharu, opencv, vigra, postgresql, Cocoa,
unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }: unixODBC , poppler, hdf4, hdf5, netcdf, sqlite, qhull, giflib }:
@ -9,7 +9,7 @@ stdenv.mkDerivation {
# See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs # See https://groups.google.com/forum/#!topic/nix-devel/h_vSzEJAPXs
# for why the have additional buildInputs on darwin # for why the have additional buildInputs on darwin
buildInputs = [ gdal wxGTK30 proj libharu opencv vigra postgresql libiodbc lzma buildInputs = [ gdal wxGTK30 proj libharu opencv vigra postgresql libiodbc lzma
jasper qhull giflib ] qhull giflib ]
++ stdenv.lib.optionals stdenv.isDarwin ++ stdenv.lib.optionals stdenv.isDarwin
[ Cocoa unixODBC poppler hdf4.out hdf5 netcdf sqlite ]; [ Cocoa unixODBC poppler hdf4.out hdf5 netcdf sqlite ];

View File

@ -26,7 +26,7 @@
, exiv2 , exiv2
, ffmpeg , ffmpeg
, flex , flex
, jasper , jasper ? null, withJpeg2k ? false # disable JPEG2000 support, jasper has unfixed CVE
, lcms2 , lcms2
, lensfun , lensfun
, libgphoto2 , libgphoto2
@ -70,7 +70,6 @@ mkDerivation rec {
exiv2 exiv2
ffmpeg ffmpeg
flex flex
jasper
lcms2 lcms2
lensfun lensfun
libgphoto2 libgphoto2
@ -103,7 +102,8 @@ mkDerivation rec {
marble marble
oxygen oxygen
threadweaver threadweaver
]; ]
++ lib.optionals withJpeg2k [ jasper ];
enableParallelBuilding = true; enableParallelBuilding = true;

View File

@ -3,7 +3,7 @@
, enableGSL ? true, gsl , enableGSL ? true, gsl
, enableGhostScript ? true, ghostscript , enableGhostScript ? true, ghostscript
, enableMuPDF ? true, mupdf , enableMuPDF ? true, mupdf
, enableJPEG2K ? true, jasper , enableJPEG2K ? false, jasper ? null # disabled by default, jasper has unfixed CVE
, enableDJVU ? true, djvulibre , enableDJVU ? true, djvulibre
, enableGOCR ? false, gocr # Disabled by default due to crashes , enableGOCR ? false, gocr # Disabled by default due to crashes
, enableTesseract ? true, leptonica, tesseract4 , enableTesseract ? true, leptonica, tesseract4

View File

@ -9,7 +9,7 @@
, libXinerama, libXrandr , libXinerama, libXrandr
, libXtst, libXfixes, systemd , libXtst, libXfixes, systemd
, alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl , alsaLib, libGLU, libGL, glew, fontconfig, freetype, ftgl
, libjpeg, jasper, libpng, libtiff , libjpeg, libpng, libtiff
, libmpeg2, libsamplerate, libmad , libmpeg2, libsamplerate, libmad
, libogg, libvorbis, flac, libxslt , libogg, libvorbis, flac, libxslt
, lzo, libcdio, libmodplug, libass, libbluray , lzo, libcdio, libmodplug, libass, libbluray
@ -157,7 +157,7 @@ in stdenv.mkDerivation {
libX11 xorgproto libXt libXmu libXext libX11 xorgproto libXt libXmu libXext
libXinerama libXrandr libXtst libXfixes libXinerama libXrandr libXtst libXfixes
alsaLib libGL libGLU glew fontconfig freetype ftgl alsaLib libGL libGLU glew fontconfig freetype ftgl
libjpeg jasper libpng libtiff libjpeg libpng libtiff
libmpeg2 libsamplerate libmad libmpeg2 libsamplerate libmad
libogg libvorbis flac libxslt systemd libogg libvorbis flac libxslt systemd
lzo libcdio libmodplug libass libbluray lzo libcdio libmodplug libass libbluray

View File

@ -1,6 +1,6 @@
{ stdenv, fetchurl, nixosTests, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl { stdenv, fetchurl, nixosTests, fixDarwinDylibNames, meson, ninja, pkgconfig, gettext, python3, libxml2, libxslt, docbook_xsl
, docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3 , docbook_xml_dtd_43, gtk-doc, glib, libtiff, libjpeg, libpng, libX11, gnome3
, jasper, gobject-introspection, doCheck ? false, makeWrapper }: , gobject-introspection, doCheck ? false, makeWrapper }:
let let
pname = "gdk-pixbuf"; pname = "gdk-pixbuf";
@ -31,11 +31,10 @@ in stdenv.mkDerivation rec {
] ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames; ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ]; propagatedBuildInputs = [ glib libtiff libjpeg libpng ];
mesonFlags = [ mesonFlags = [
"-Ddocs=true" "-Ddocs=true"
"-Djasper=true"
"-Dx11=true" "-Dx11=true"
"-Dgir=${if gobject-introspection != null then "true" else "false"}" "-Dgir=${if gobject-introspection != null then "true" else "false"}"
"-Dgio_sniffing=false" "-Dgio_sniffing=false"

View File

@ -1,5 +1,5 @@
{ fetchurl, stdenv, { fetchurl, fetchpatch, stdenv,
cmake, netcdf, gfortran, jasper, libpng, cmake, netcdf, gfortran, libpng, openjpeg,
enablePython ? false, pythonPackages }: enablePython ? false, pythonPackages }:
stdenv.mkDerivation rec{ stdenv.mkDerivation rec{
@ -11,6 +11,13 @@ stdenv.mkDerivation rec{
sha256 = "0qbj12ap7yy2rl1pq629chnss2jl73wxdj1lwzv0xp87r6z5qdfl"; sha256 = "0qbj12ap7yy2rl1pq629chnss2jl73wxdj1lwzv0xp87r6z5qdfl";
}; };
patches = [
(fetchpatch {
url = "https://salsa.debian.org/science-team/grib-api/raw/debian/1.28.0-2/debian/patches/openjpeg2.patch";
sha256 = "05faxh51vlidiazxq1ssd3k4cjivk1adyn30k94mxqa1xnb2r2pc";
})
];
preConfigure = '' preConfigure = ''
# Fix "no member named 'inmem_' in 'jas_image_t'" # Fix "no member named 'inmem_' in 'jas_image_t'"
substituteInPlace "src/grib_jasper_encoding.c" --replace "image.inmem_ = 1;" "" substituteInPlace "src/grib_jasper_encoding.c" --replace "image.inmem_ = 1;" ""
@ -19,8 +26,8 @@ stdenv.mkDerivation rec{
buildInputs = [ cmake buildInputs = [ cmake
netcdf netcdf
gfortran gfortran
jasper
libpng libpng
openjpeg
] ++ stdenv.lib.optionals enablePython [ ] ++ stdenv.lib.optionals enablePython [
pythonPackages.python pythonPackages.python
]; ];
@ -32,6 +39,7 @@ stdenv.mkDerivation rec{
cmakeFlags = [ "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}" cmakeFlags = [ "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
"-DENABLE_PNG=ON" "-DENABLE_PNG=ON"
"-DENABLE_FORTRAN=ON" "-DENABLE_FORTRAN=ON"
"-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/${openjpeg.incDir}"
]; ];
enableParallelBuilding = true; enableParallelBuilding = true;
@ -52,13 +60,15 @@ stdenv.mkDerivation rec{
homepage = https://software.ecmwf.int/wiki/display/GRIB/Home; homepage = https://software.ecmwf.int/wiki/display/GRIB/Home;
license = licenses.asl20; license = licenses.asl20;
platforms = with platforms; linux ++ darwin; platforms = with platforms; linux ++ darwin;
description = "ECMWF Library for the GRIB file format"; description = "ECMWF Library for the GRIB file format -- DEPRECATED";
longDescription = '' longDescription = ''
The ECMWF GRIB API is an application program interface accessible from C, The ECMWF GRIB API is an application program interface accessible from C,
FORTRAN and Python programs developed for encoding and decoding WMO FM-92 FORTRAN and Python programs developed for encoding and decoding WMO FM-92
GRIB edition 1 and edition 2 messages. GRIB edition 1 and edition 2 messages.
Please note: GRIB-API support is being discontinued at the end of 2018.
After which there will be no further releases. Please upgrade to ecCodes
''; '';
maintainers = with maintainers; [ knedlsepp ]; maintainers = with maintainers; [ knedlsepp ];
}; };
} }

View File

@ -42,5 +42,10 @@ stdenv.mkDerivation rec {
platforms = platforms.unix; platforms = platforms.unix;
license = licenses.jasper; license = licenses.jasper;
maintainers = with maintainers; [ pSub ]; maintainers = with maintainers; [ pSub ];
knownVulnerabilities = [
"Numerous CVE unsolved upstream"
"See: https://github.com/NixOS/nixpkgs/pull/57681#issuecomment-475857499"
"See: https://github.com/mdadams/jasper/issues/208"
];
}; };
} }

View File

@ -1,14 +1,24 @@
{ stdenv, fetchurl, libpng, jasper }: { stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, openjpeg }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "libicns-0.8.1"; pname = "libicns";
version = "0.8.1";
src = fetchurl { src = fetchurl {
url = "mirror://sourceforge/icns/${name}.tar.gz"; url = "mirror://sourceforge/icns/${pname}-${version}.tar.gz";
sha256 = "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk"; sha256 = "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk";
}; };
buildInputs = [ libpng jasper ]; patches = [
(fetchpatch {
url = "https://sources.debian.org/data/main/libi/libicns/0.8.1-3.1/debian/patches/support-libopenjp2.patch";
sha256 = "0ss298lyzvydxvaxsadi6kbbjpwykd86jw3za76brcsg2dpssgas";
})
];
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ libpng openjpeg ];
NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
meta = with stdenv.lib; { meta = with stdenv.lib; {
description = "Library for manipulation of the Mac OS icns resource format"; description = "Library for manipulation of the Mac OS icns resource format";

View File

@ -1,4 +1,7 @@
{ stdenv, fetchurl, lcms2, jasper, pkgconfig }: { stdenv, fetchurl, lcms2, pkgconfig
, jasper ? null, withJpeg2k ? false
# disable JPEG2000 support by default as jasper has many CVE
}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "libraw"; pname = "libraw";
@ -11,7 +14,7 @@ stdenv.mkDerivation rec {
outputs = [ "out" "lib" "dev" "doc" ]; outputs = [ "out" "lib" "dev" "doc" ];
buildInputs = [ jasper ]; buildInputs = stdenv.lib.optionals withJpeg2k [ jasper ];
propagatedBuildInputs = [ lcms2 ]; propagatedBuildInputs = [ lcms2 ];

View File

@ -9,7 +9,7 @@
, enableTIFF ? true, libtiff , enableTIFF ? true, libtiff
, enableWebP ? true, libwebp , enableWebP ? true, libwebp
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase , enableEXR ? !stdenv.isDarwin, openexr, ilmbase
, enableJPEG2K ? true, jasper , enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
, enableEigen ? true, eigen , enableEigen ? true, eigen
, enableOpenblas ? true, openblas , enableOpenblas ? true, openblas
, enableContrib ? true , enableContrib ? true

View File

@ -9,7 +9,7 @@
, enableTIFF ? true, libtiff , enableTIFF ? true, libtiff
, enableWebP ? true, libwebp , enableWebP ? true, libwebp
, enableEXR ? !stdenv.isDarwin, openexr, ilmbase , enableEXR ? !stdenv.isDarwin, openexr, ilmbase
, enableJPEG2K ? true, jasper , enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
, enableEigen ? true, eigen , enableEigen ? true, eigen
, enableOpenblas ? true, openblas , enableOpenblas ? true, openblas
, enableContrib ? true , enableContrib ? true

View File

@ -6,7 +6,7 @@
, enablePNG ? true, libpng , enablePNG ? true, libpng
, enableTIFF ? true, libtiff , enableTIFF ? true, libtiff
, enableEXR ? (!stdenv.isDarwin), openexr, ilmbase , enableEXR ? (!stdenv.isDarwin), openexr, ilmbase
, enableJPEG2K ? true, jasper , enableJPEG2K ? false, jasper # disable jasper by default (many CVE)
, enableFfmpeg ? false, ffmpeg , enableFfmpeg ? false, ffmpeg
, enableGStreamer ? false, gst_all_1 , enableGStreamer ? false, gst_all_1
, enableEigen ? true, eigen , enableEigen ? true, eigen

View File

@ -2,7 +2,7 @@
libX11, libXinerama, libXrandr, libGLU, libGL, libX11, libXinerama, libXrandr, libGLU, libGL,
glib, ilmbase, libxml2, pcre, zlib, glib, ilmbase, libxml2, pcre, zlib,
jpegSupport ? true, libjpeg, jpegSupport ? true, libjpeg,
jasperSupport ? true, jasper, jasperSupport ? false, jasper, # disable jasper by default (many CVE)
exrSupport ? false, openexr, exrSupport ? false, openexr,
gifSupport ? true, giflib, gifSupport ? true, giflib,
pngSupport ? true, libpng, pngSupport ? true, libpng,

View File

@ -4,7 +4,7 @@ stdenv.mkDerivation rec {
name = "dcraw-9.28.0"; name = "dcraw-9.28.0";
src = fetchurl { src = fetchurl {
url = "https://www.cybercom.net/~dcoffin/dcraw/archive/${name}.tar.gz"; url = "https://www.dechifro.org/dcraw/archive/${name}.tar.gz";
sha256 = "1fdl3xa1fbm71xzc3760rsjkvf0x5jdjrvdzyg2l9ka24vdc7418"; sha256 = "1fdl3xa1fbm71xzc3760rsjkvf0x5jdjrvdzyg2l9ka24vdc7418";
}; };
@ -23,10 +23,17 @@ stdenv.mkDerivation rec {
''; '';
meta = { meta = {
homepage = http://www.cybercom.net/~dcoffin/dcraw/; homepage = https://www.dechifro.org/dcraw/;
description = "Decoder for many camera raw picture formats"; description = "Decoder for many camera raw picture formats";
license = stdenv.lib.licenses.free; license = stdenv.lib.licenses.free;
platforms = stdenv.lib.platforms.unix; # Once had cygwin problems platforms = stdenv.lib.platforms.unix; # Once had cygwin problems
maintainers = [ ]; maintainers = [ ];
knownVulnerabilities = [
"CVE-2018-19655"
"CVE-2018-19565"
"CVE-2018-19566"
"CVE-2018-19567"
"CVE-2018-19568"
];
}; };
} }