Vulnerabilities > CVE-2016-0771 - Improper Restriction of Operations within the Bounds of a Memory Buffer vulnerability in Samba

047910
CVSS 4.9 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
SINGLE
Confidentiality impact
PARTIAL
Integrity impact
NONE
Availability impact
PARTIAL
network
samba
CWE-119
nessus

Summary

The internal DNS server in Samba 4.x before 4.1.23, 4.2.x before 4.2.9, 4.3.x before 4.3.6, and 4.4.x before 4.4.0rc4, when an AD DC is configured, allows remote authenticated users to cause a denial of service (out-of-bounds read) or possibly obtain sensitive information from process memory by uploading a crafted DNS TXT record.

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Buffer Overflow via Environment Variables
    This attack pattern involves causing a buffer overflow through manipulation of environment variables. Once the attacker finds that they can modify an environment variable, they may try to overflow associated buffers. This attack leverages implicit trust often placed in environment variables.
  • Overflow Buffers
    Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an attacker. As a consequence, an attacker is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the attackers' choice.
  • Client-side Injection-induced Buffer Overflow
    This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.
  • Filter Failure through Buffer Overflow
    In this attack, the idea is to cause an active filter to fail by causing an oversized transaction. An attacker may try to feed overly long input strings to the program in an attempt to overwhelm the filter (by causing a buffer overflow) and hoping that the filter does not fail securely (i.e. the user input is let into the system unfiltered).
  • MIME Conversion
    An attacker exploits a weakness in the MIME conversion routine to cause a buffer overflow and gain control over the mail server machine. The MIME system is designed to allow various different information formats to be interpreted and sent via e-mail. Attack points exist when data are converted to MIME compatible format and back.

Nessus

  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-3514.NASL
    descriptionSeveral vulnerabilities have been discovered in Samba, a SMB/CIFS file, print, and login server for Unix. The Common Vulnerabilities and Exposures project identifies the following issues : - CVE-2015-7560 Jeremy Allison of Google, Inc. and the Samba Team discovered that Samba incorrectly handles getting and setting ACLs on a symlink path. An authenticated malicious client can use SMB1 UNIX extensions to create a symlink to a file or directory, and then use non-UNIX SMB1 calls to overwrite the contents of the ACL on the file or directory linked to. - CVE-2016-0771 Garming Sam and Douglas Bagnall of Catalyst IT discovered that Samba is vulnerable to an out-of-bounds read issue during DNS TXT record handling, if Samba is deployed as an AD DC and chosen to run the internal DNS server. A remote attacker can exploit this flaw to cause a denial of service (Samba crash), or potentially, to allow leakage of memory from the server in the form of a DNS TXT reply. Additionally this update includes a fix for a regression introduced due to the upstream fix for CVE-2015-5252 in DSA-3433-1 in setups where the share path is
    last seen2020-06-01
    modified2020-06-02
    plugin id89876
    published2016-03-14
    reporterThis script is Copyright (C) 2016-2018 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89876
    titleDebian DSA-3514-1 : samba - security update
    code
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text and package checks in this plugin were  
    # extracted from Debian Security Advisory DSA-3514. The text 
    # itself is copyright (C) Software in the Public Interest, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(89876);
      script_version("2.7");
      script_cvs_date("Date: 2018/11/10 11:49:37");
    
      script_cve_id("CVE-2015-7560", "CVE-2016-0771");
      script_xref(name:"DSA", value:"3514");
    
      script_name(english:"Debian DSA-3514-1 : samba - security update");
      script_summary(english:"Checks dpkg output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Debian host is missing a security-related update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "Several vulnerabilities have been discovered in Samba, a SMB/CIFS
    file, print, and login server for Unix. The Common Vulnerabilities and
    Exposures project identifies the following issues :
    
      - CVE-2015-7560
        Jeremy Allison of Google, Inc. and the Samba Team
        discovered that Samba incorrectly handles getting and
        setting ACLs on a symlink path. An authenticated
        malicious client can use SMB1 UNIX extensions to create
        a symlink to a file or directory, and then use non-UNIX
        SMB1 calls to overwrite the contents of the ACL on the
        file or directory linked to.
    
      - CVE-2016-0771
        Garming Sam and Douglas Bagnall of Catalyst IT
        discovered that Samba is vulnerable to an out-of-bounds
        read issue during DNS TXT record handling, if Samba is
        deployed as an AD DC and chosen to run the internal DNS
        server. A remote attacker can exploit this flaw to cause
        a denial of service (Samba crash), or potentially, to
        allow leakage of memory from the server in the form of a
        DNS TXT reply.
    
    Additionally this update includes a fix for a regression introduced
    due to the upstream fix for CVE-2015-5252 in DSA-3433-1 in setups
    where the share path is '/'."
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=812429"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2015-7560"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2016-0771"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2015-5252"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://security-tracker.debian.org/tracker/CVE-2016-0771"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://packages.debian.org/source/wheezy/samba"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://packages.debian.org/source/jessie/samba"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"https://www.debian.org/security/2016/dsa-3514"
      );
      script_set_attribute(
        attribute:"solution", 
        value:
    "Upgrade the samba packages.
    
    For the oldstable distribution (wheezy), these problems have been
    fixed in version 2:3.6.6-6+deb7u7. The oldstable distribution (wheezy)
    is not affected by CVE-2016-0771.
    
    For the stable distribution (jessie), these problems have been fixed
    in version 2:4.1.17+dfsg-2+deb8u2."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:S/C:P/I:N/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:L/UI:N/S:U/C:N/I:H/A:N");
      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:samba");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:7.0");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:debian:debian_linux:8.0");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2016/03/12");
      script_set_attribute(attribute:"plugin_publication_date", value:"2016/03/14");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2016-2018 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:"libnss-winbind", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libpam-smbpass", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libpam-winbind", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libsmbclient", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libsmbclient-dev", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libwbclient-dev", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"libwbclient0", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-common", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-common-bin", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-dbg", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-doc", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-doc-pdf", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"samba-tools", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"smbclient", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"swat", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"7.0", prefix:"winbind", reference:"2:3.6.6-6+deb7u7")) flag++;
    if (deb_check(release:"8.0", prefix:"libnss-winbind", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libpam-smbpass", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libpam-winbind", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libparse-pidl-perl", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libsmbclient", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libsmbclient-dev", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libsmbsharemodes-dev", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libsmbsharemodes0", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libwbclient-dev", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"libwbclient0", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"python-samba", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"registry-tools", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-common", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-common-bin", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-dbg", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-dev", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-doc", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-dsdb-modules", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-libs", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-testsuite", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"samba-vfs-modules", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"smbclient", reference:"2:4.1.17+dfsg-2+deb8u2")) flag++;
    if (deb_check(release:"8.0", prefix:"winbind", reference:"2:4.1.17+dfsg-2+deb8u2")) 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 familyMisc.
    NASL idSAMBA_4_3_6.NASL
    descriptionAccording to its banner, the version of Samba running on the remote host is 3.2.x prior to 4.1.23, 4.2.x prior to 4.2.9, 4.3.x prior to 4.3.6, or 4.4.0 prior to 4.4.0rc4. It is, therefore, affected by the following vulnerabilities : - A security bypass vulnerability exists in the SMB1 implementation that is triggered when a symlink created to a file or directory using SMB1 UNIX extensions is accessed using non-UNIX SMB1 calls. An authenticated, remote attacker can exploit this to overwrite file and directory ACLs. (CVE-2015-7560) - An out-of-bounds read error exists in the internal DNS server due to improper handling of TXT records when an AD DC is configured. An authenticated, remote attacker can exploit this, via a crafted DNS TXT record, to cause a crash or disclose memory contents. (CVE-2016-0771) Note that Nessus has not tested for these issues but has instead relied only on the application
    last seen2020-06-01
    modified2020-06-02
    plugin id90098
    published2016-03-23
    reporterThis script is Copyright (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/90098
    titleSamba 3.2.x < 4.1.23 / 4.2.x < 4.2.9 / 4.3.x < 4.3.6 / 4.4.0 < 4.4.0rc4 Multiple Vulnerabilities
  • NASL familyUbuntu Local Security Checks
    NASL idUBUNTU_USN-2922-1.NASL
    descriptionJeremy Allison discovered that Samba incorrectly handled ACLs on symlink paths. A remote attacker could use this issue to overwrite the ownership of ACLs using symlinks. (CVE-2015-7560) Garming Sam and Douglas Bagnall discovered that the Samba internal DNS server incorrectly handled certain DNS TXT records. A remote attacker could use this issue to cause Samba to crash, resulting in a denial of service, or possibly obtain uninitialized memory contents. This issue only applied to Ubuntu 14.04 LTS and Ubuntu 15.10. (CVE-2016-0771) It was discovered that the Samba Web Administration Tool (SWAT) was vulnerable to clickjacking and cross-site request forgery attacks. This issue only affected Ubuntu 12.04 LTS. (CVE-2013-0213, CVE-2013-0214). Note that Tenable Network Security has extracted the preceding description block directly from the Ubuntu security advisory. Tenable has attempted to automatically clean and format it as much as possible without introducing additional issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id89777
    published2016-03-09
    reporterUbuntu Security Notice (C) 2016-2019 Canonical, Inc. / NASL script (C) 2016-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/89777
    titleUbuntu 12.04 LTS / 14.04 LTS / 15.10 : samba vulnerabilities (USN-2922-1)
  • NASL familySlackware Local Security Checks
    NASL idSLACKWARE_SSA_2016-068-02.NASL
    descriptionNew samba packages are available for Slackware 14.1 and -current to fix security issues.
    last seen2020-06-01
    modified2020-06-02
    plugin id89759
    published2016-03-09
    reporterThis script is Copyright (C) 2016 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/89759
    titleSlackware 14.1 / current : samba (SSA:2016-068-02)
  • NASL familySuSE Local Security Checks
    NASL idOPENSUSE-2016-359.NASL
    descriptionThis update for samba fixes the following issues : Version update to 4.1.23. + Getting and setting Windows ACLs on symlinks can change permissions on link target; CVE-2015-7560; (bso#11648); (boo#968222). + Fix Out-of-bounds read in internal DNS server; CVE-2016-0771; (bso#11128); (bso#11686); (boo#968223). Also fixed : - Ensure samlogon fallback requests are rerouted after kerberos failure; (bnc#953382); (bnc#953972).
    last seen2020-06-05
    modified2016-03-21
    plugin id90054
    published2016-03-21
    reporterThis script is Copyright (C) 2016-2020 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/90054
    titleopenSUSE Security Update : samba (openSUSE-2016-359)