Vulnerabilities > CVE-2016-1516 - Double Free vulnerability in multiple products

047910
CVSS 8.8 - HIGH
Attack vector
NETWORK
Attack complexity
LOW
Privileges required
NONE
Confidentiality impact
HIGH
Integrity impact
HIGH
Availability impact
HIGH
network
low complexity
opencv
debian
CWE-415
nessus

Summary

OpenCV 3.0.0 has a double free issue that allows attackers to execute arbitrary code.

Vulnerable Configurations

Part Description Count
Application
Opencv
1
OS
Debian
2

Common Weakness Enumeration (CWE)

Nessus

  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-1117.NASL
    descriptionOpenCV through version 3.3 has out-of-bounds read/write errors, buffer overflows and double free issues in different functions. For Debian 7
    last seen2020-03-17
    modified2017-10-02
    plugin id103575
    published2017-10-02
    reporterThis script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/103575
    titleDebian DLA-1117-1 : opencv security update
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were
    # extracted from Debian Security Advisory DLA-1117-1. The text
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(103575);
      script_version("3.5");
      script_set_attribute(attribute:"plugin_modification_date", value:"2020/03/12");
    
      script_cve_id("CVE-2016-1516", "CVE-2017-12597", "CVE-2017-12598", "CVE-2017-12599", "CVE-2017-12601", "CVE-2017-12603", "CVE-2017-12604", "CVE-2017-12605", "CVE-2017-12606", "CVE-2017-12862", "CVE-2017-12863", "CVE-2017-12864", "CVE-2017-14136");
    
      script_name(english:"Debian DLA-1117-1 : opencv security update");
      script_summary(english:"Checks dpkg output for the updated packages.");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "OpenCV through version 3.3 has out-of-bounds read/write errors, buffer
    overflows and double free issues in different functions.
    
    For Debian 7 'Wheezy', these problems have been fixed in version
    2.3.1-11+deb7u2.
    
    We recommend that you upgrade your opencv packages.
    
    NOTE: Tenable Network Security has extracted the preceding description
    block directly from the DLA security advisory. Tenable has attempted
    to automatically clean and format it as much as possible without
    introducing additional issues."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://lists.debian.org/debian-lts-announce/2017/09/msg00034.html"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://packages.debian.org/source/wheezy/opencv"
      );
      script_set_attribute(attribute:"solution", value:"Upgrade the affected packages.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:P/A:P");
      script_set_cvss_temporal_vector("CVSS2#E:U/RL:OF/RC:C");
      script_set_cvss3_base_vector("CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H");
      script_set_cvss3_temporal_vector("CVSS:3.0/E:U/RL:O/RC:C");
      script_set_attribute(attribute:"exploitability_ease", value:"No known exploits are available");
      script_set_attribute(attribute:"exploit_available", value:"false");
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libcv-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libcv2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libcvaux-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libcvaux2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libhighgui-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libhighgui2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-calib3d-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-calib3d2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-contrib-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-contrib2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-core-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-core2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-features2d-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-features2d2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-flann-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-flann2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-gpu-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-gpu2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-highgui-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-highgui2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-imgproc-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-imgproc2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-legacy-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-legacy2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-ml-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-ml2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-objdetect-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-objdetect2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-video-dev");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:libopencv-video2.3");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:opencv-doc");
      script_set_attribute(attribute:"cpe", value:"p-cpe:/a:debian:debian_linux:python-opencv");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:7.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2017/09/29");
      script_set_attribute(attribute:"plugin_publication_date", value:"2017/10/02");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2017-2020 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Debian Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/Debian/release", "Host/Debian/dpkg-l");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("debian_package.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    if (!get_kb_item("Host/Debian/release")) audit(AUDIT_OS_NOT, "Debian");
    if (!get_kb_item("Host/Debian/dpkg-l")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    
    flag = 0;
    if (deb_check(release:"7.0", prefix:"libcv-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libcv2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libcvaux-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libcvaux2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libhighgui-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libhighgui2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-calib3d-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-calib3d2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-contrib-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-contrib2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-core-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-core2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-features2d-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-features2d2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-flann-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-flann2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-gpu-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-gpu2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-highgui-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-highgui2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-imgproc-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-imgproc2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-legacy-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-legacy2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-ml-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-ml2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-objdetect-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-objdetect2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-video-dev", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"libopencv-video2.3", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"opencv-doc", reference:"2.3.1-11+deb7u2")) flag++;
    if (deb_check(release:"7.0", prefix:"python-opencv", reference:"2.3.1-11+deb7u2")) flag++;
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:deb_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2018-455.NASL
    descriptionThis update for opencv fixes the following issues : - CVE-2016-1517: Fixed a denial of service (segfault) via vectors involving corrupt chunks (boo#1033150) - CVE-2016-1516: Fixed a double free issue that allows attackers to execute arbitrary code (boo#1033152).
    last seen2020-06-05
    modified2018-05-14
    plugin id109752
    published2018-05-14
    reporterThis script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/109752
    titleopenSUSE Security Update : opencv (openSUSE-2018-455)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2018-492.NASL
    descriptionThis update for opencv fixes the following issues : Security issues fixed : - CVE-2016-1516: OpenCV had a double free issue that allowed attackers to execute arbitrary code. (boo#1033152) - CVE-2017-14136: OpenCV had an out-of-bounds write error in the function FillColorRow1 in utils.cpp when reading an image file by using cv::imread. NOTE: this vulnerability exists because of an incomplete fix for CVE-2017-12597. (boo#1057146) - CVE-2017-12606: OpenCV had an out-of-bounds write error in the function FillColorRow4 in utils.cpp when reading an image file by using cv::imread. (boo#1052451) - CVE-2017-12604: OpenCV had an out-of-bounds write error in the FillUniColor function in utils.cpp when reading an image file by using cv::imread. (boo#1052454) - CVE-2017-12603: OpenCV had an invalid write in the cv::RLByteStream::getBytes function in modules/imgcodecs/src/bitstrm.cpp when reading an image file by using cv::imread, as demonstrated by the 2-opencv-heapoverflow-fseek test case. (boo#1052455) - CVE-2017-12602: OpenCV had a denial of service (memory consumption) issue, as demonstrated by the 10-opencv-dos-memory-exhaust test case. (boo#1052456) - CVE-2017-12601: OpenCV had a buffer overflow in the cv::BmpDecoder::readData function in modules/imgcodecs/src/grfmt_bmp.cpp when reading an image file by using cv::imread, as demonstrated by the 4-buf-overflow-readData-memcpy test case. (boo#1052457) - CVE-2017-12600: OpenCV had a denial of service (CPU consumption) issue, as demonstrated by the 11-opencv-dos-cpu-exhaust test case. (boo#1052459) - CVE-2017-12599: OpenCV had an out-of-bounds read error in the function icvCvt_BGRA2BGR_8u_C4C3R when reading an image file by using cv::imread. (boo#1052461) - CVE-2017-12598: OpenCV had an out-of-bounds read error in the cv::RBaseStream::readBlock function in modules/imgcodecs/src/bitstrm.cpp when reading an image file by using cv::imread, as demonstrated by the 8-opencv-invalid-read-fread test case. (boo#1052462) - CVE-2017-12597: OpenCV had an out-of-bounds write error in the function FillColorRow1 in utils.cpp when reading an image file by using cv::imread. (boo#1052465) - CVE-2017-12864: In opencv/modules/imgcodecs/src/grfmt_pxm.cpp, function ReadNumber did not checkout the input length, which lead to integer overflow. If the image is from remote, may lead to remote code execution or denial of service. (boo#1054019) - CVE-2017-12863: In opencv/modules/imgcodecs/src/grfmt_pxm.cpp, function PxMDecoder::readData has an integer overflow when calculate src_pitch. If the image is from remote, may lead to remote code execution or denial of service. (boo#1054020) - CVE-2017-12862: In modules/imgcodecs/src/grfmt_pxm.cpp, the length of buffer AutoBuffer _src is small than expected, which will cause copy buffer overflow later. If the image is from remote, may lead to remote code execution or denial of service. (boo#1054021) - CVE-2017-12605: OpenCV had an out-of-bounds write error in the FillColorRow8 function in utils.cpp when reading an image file by using cv::imread. (boo#1054984)
    last seen2020-06-05
    modified2018-05-24
    plugin id110066
    published2018-05-24
    reporterThis script is Copyright (C) 2018-2020 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/110066
    titleopenSUSE Security Update : opencv (openSUSE-2018-492)
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DLA-1438.NASL
    descriptionEarly versions of opencv have problems while reading data, which might result in either buffer overflows, out-of bounds errors or integer overflows. Further assertion errors might happen due to incorrect integer cast. For Debian 8
    last seen2020-06-01
    modified2020-06-02
    plugin id111223
    published2018-07-23
    reporterThis script is Copyright (C) 2018-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/111223
    titleDebian DLA-1438-1 : opencv security update