-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
imgcodecs: avoid vulnerabilities in Jasper codec (JPEG-2000) #14058
Description
Jasper project has many opened vulnerabilities which are not get fixed for a long time.
Especially in version 1.900 which is used by OpenCV.
It is not safe to open external/untrusted JPEG-2000 images via imread()/imdecode().
Perhaps it is not save to use encoder too via imwrite()/imencode().
Possible alternative to Jasper codec is OpenJPEG, which should replace Jasper in OpenCV in the future.
Changes:
-
Add runtime option
OPENCV_IO_ENABLE_JASPER.
Turned OFF by default (for current outdated code of Jasper 1.900).
Prevents calling of Jasper code from OpenCV, prints warning message with the link on this issue.
Users are still able to turn ON this option during runtime. Use it at your own risk!
PR: imgcodecs: OPENCV_IO_ENABLE_JASPER runtime parameter #14059
OpenCV versions: 3.4.6+ / 4.1.0+ -
Change CMake defaults: BUILD_JASPER=OFF.
TBD -
Change CMake defaults: WITH_JASPER=OFF
TBD
- Jasper has been excluded from Ubuntu 18.04 distribution (Ubuntu 16.04 package)
- relates Application crashed when imdecode() is called for .jp2 image #5849