Vulnerabilities > CVE-2007-5794 - Race Condition vulnerability in NSS Ldap NSS Ldap

047910
CVSS 4.3 - MEDIUM
Attack vector
NETWORK
Attack complexity
MEDIUM
Privileges required
NONE
Confidentiality impact
PARTIAL
Integrity impact
NONE
Availability impact
NONE
network
nss-ldap
CWE-362
nessus

Summary

Race condition in nss_ldap, when used in applications that are linked against the pthread library and fork after a call to nss_ldap, might send user data to the wrong process because of improper handling of the LDAP connection. NOTE: this issue was originally reported for Dovecot with the wrong mailboxes being returned, but other applications might also be affected.

Vulnerable Configurations

Part Description Count
Application
Nss_Ldap
1

Common Attack Pattern Enumeration and Classification (CAPEC)

  • Leveraging Race Conditions
    This attack targets a race condition occurring when multiple processes access and manipulate the same resource concurrently and the outcome of the execution depends on the particular order in which the access takes place. The attacker can leverage a race condition by "running the race", modifying the resource and modifying the normal execution flow. For instance a race condition can occur while accessing a file, the attacker can trick the system by replacing the original file with his version and cause the system to read the malicious file.
  • Leveraging Time-of-Check and Time-of-Use (TOCTOU) Race Conditions
    This attack targets a race condition occurring between the time of check (state) for a resource and the time of use of a resource. The typical example is the file access. The attacker can leverage a file access race condition by "running the race", meaning that he would modify the resource between the first time the target program accesses the file and the time the target program uses the file. During that period of time, the attacker could do something such as replace the file and cause an escalation of privilege.

Nessus

  • NASL familyScientific Linux Local Security Checks
    NASL idSL_20080521_NSS_LDAP_ON_SL5_X.NASL
    descriptionA race condition was discovered in nss_ldap which affected certain applications which make LDAP connections, such as Dovecot. This could cause nss_ldap to answer a request for information about one user with information about a different user. (CVE-2007-5794) In addition, these updated packages fix the following bugs : - a build error prevented the nss_ldap module from being able to use DNS to discover the location of a directory server. For example, when the /etc/nsswitch.conf configuration file was configured to use
    last seen2020-06-01
    modified2020-06-02
    plugin id60407
    published2012-08-01
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/60407
    titleScientific Linux Security Update : nss_ldap on SL5.x i386/x86_64
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The descriptive text is (C) Scientific Linux.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(60407);
      script_version("1.5");
      script_cvs_date("Date: 2019/10/25 13:36:17");
    
      script_cve_id("CVE-2007-5794");
    
      script_name(english:"Scientific Linux Security Update : nss_ldap on SL5.x i386/x86_64");
      script_summary(english:"Checks rpm output for the updated package");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote Scientific Linux host is missing a security update."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "A race condition was discovered in nss_ldap which affected certain
    applications which make LDAP connections, such as Dovecot. This could
    cause nss_ldap to answer a request for information about one user with
    information about a different user. (CVE-2007-5794)
    
    In addition, these updated packages fix the following bugs :
    
      - a build error prevented the nss_ldap module from being
        able to use DNS to discover the location of a directory
        server. For example, when the /etc/nsswitch.conf
        configuration file was configured to use 'ldap', but no
        'host' or 'uri' option was configured in the
        /etc/ldap.conf configuration file, no directory server
        was contacted, and no results were returned.
    
      - the 'port' option in the /etc/ldap.conf configuration
        file on client machines was ignored. For example, if a
        directory server which you were attempting to use was
        listening on a non-default port (i.e. not ports 389 or
        636), it was only possible to use that directory server
        by including the port number in the 'uri' option. In
        this updated package, the 'port' option works as
        expected.
    
      - pam_ldap failed to change an expired password if it had
        to follow a referral to do so, which could occur, for
        example, when using a slave directory server in a
        replicated environment. An error such as the following
        occurred after entering a new password: 'LDAP password
        information update failed: Can't contact LDAP server
        Insufficient 'write' privilege to the 'userPassword'
        attribute'
    
    This has been resolved in this updated package.
    
      - when the 'pam_password exop_send_old' password-change
        method was configured in the /etc/ldap.conf
        configuration file, a logic error in the pam_ldap module
        caused client machines to attempt to change a user's
        password twice. First, the pam_ldap module attempted to
        change the password using the 'exop' request, and then
        again using an LDAP modify request.
    
      - on Red Hat Enterprise Linux 5.1, rebuilding
        nss_ldap-253-5.el5 when the krb5-*-1.6.1-17.el5 packages
        were installed failed due to an error such as the
        following :
    
      - /builddir/build/SOURCES/dlopen.sh
        ./nss_ldap-253/nss_ldap.so dlopen() of
        '././nss_ldap-253/nss_ldap.so' failed:
        ./././nss_ldap-253/nss_ldap.so: undefined symbol:
        request_key error: Bad exit status from
        /var/tmp/rpm-tmp.62652 (%build)
    
    The missing libraries have been added, which resolves this issue.
    
    When recursively enumerating the set of members in a given group, the
    module would allocate insufficient space for storing the set of member
    names if the group itself contained other groups, thus corrupting the
    heap. This update includes a backported fix for this bug."
      );
      # https://listserv.fnal.gov/scripts/wa.exe?A2=ind0805&L=scientific-linux-errata&T=0&P=1350
      script_set_attribute(
        attribute:"see_also",
        value:"http://www.nessus.org/u?be52862b"
      );
      script_set_attribute(
        attribute:"solution", 
        value:"Update the affected nss_ldap package."
      );
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N");
      script_cwe_id(362);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"x-cpe:/o:fermilab:scientific_linux");
    
      script_set_attribute(attribute:"vuln_publication_date", value:"2007/11/13");
      script_set_attribute(attribute:"patch_publication_date", value:"2008/05/21");
      script_set_attribute(attribute:"plugin_publication_date", value:"2012/08/01");
      script_set_attribute(attribute:"generated_plugin", value:"current");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.");
      script_family(english:"Scientific Linux Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/RedHat/release", "Host/RedHat/rpm-list");
    
      exit(0);
    }
    
    
    include("audit.inc");
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) audit(AUDIT_LOCAL_CHECKS_NOT_ENABLED);
    release = get_kb_item("Host/RedHat/release");
    if (isnull(release) || "Scientific Linux " >!< release) audit(AUDIT_HOST_NOT, "running Scientific Linux");
    if (!get_kb_item("Host/RedHat/rpm-list")) audit(AUDIT_PACKAGE_LIST_MISSING);
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) audit(AUDIT_UNKNOWN_ARCH);
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") audit(AUDIT_LOCAL_CHECKS_NOT_IMPLEMENTED, "Scientific Linux", cpu);
    
    
    flag = 0;
    if (rpm_check(release:"SL5", reference:"nss_ldap-253-12.el5")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else audit(AUDIT_HOST_NOT, "affected");
    
  • NASL familySuSE Local Security Checks
    NASL idSUSE_NSS_LDAP-4781.NASL
    descriptionnss_ldap returned incorrect data under certain circumstances to the calling process. Some applications could therefore work with wrong user data. (CVE-2007-5794)
    last seen2020-06-01
    modified2020-06-02
    plugin id30197
    published2008-02-06
    reporterThis script is Copyright (C) 2008-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/30197
    titleSuSE 10 Security Update : nss_ldap (ZYPP Patch Number 4781)
    code
    #%NASL_MIN_LEVEL 80502
    #
    # (C) Tenable Network Security, Inc.
    #
    # The text description of this plugin is (C) Novell, Inc.
    #
    
    include("compat.inc");
    
    if (description)
    {
      script_id(30197);
      script_version ("1.16");
      script_cvs_date("Date: 2019/10/25 13:36:30");
    
      script_cve_id("CVE-2007-5794");
    
      script_name(english:"SuSE 10 Security Update : nss_ldap (ZYPP Patch Number 4781)");
      script_summary(english:"Checks rpm output for the updated packages");
    
      script_set_attribute(
        attribute:"synopsis", 
        value:"The remote SuSE 10 host is missing a security-related patch."
      );
      script_set_attribute(
        attribute:"description", 
        value:
    "nss_ldap returned incorrect data under certain circumstances to the
    calling process. Some applications could therefore work with wrong
    user data. (CVE-2007-5794)"
      );
      script_set_attribute(
        attribute:"see_also",
        value:"http://support.novell.com/security/cve/CVE-2007-5794.html"
      );
      script_set_attribute(attribute:"solution", value:"Apply ZYPP patch number 4781.");
      script_set_cvss_base_vector("CVSS2#AV:N/AC:M/Au:N/C:P/I:N/A:N");
      script_cwe_id(362);
    
      script_set_attribute(attribute:"plugin_type", value:"local");
      script_set_attribute(attribute:"cpe", value:"cpe:/o:suse:suse_linux");
    
      script_set_attribute(attribute:"patch_publication_date", value:"2007/12/04");
      script_set_attribute(attribute:"plugin_publication_date", value:"2008/02/06");
      script_end_attributes();
    
      script_category(ACT_GATHER_INFO);
      script_copyright(english:"This script is Copyright (C) 2008-2019 Tenable Network Security, Inc.");
      script_family(english:"SuSE Local Security Checks");
    
      script_dependencies("ssh_get_info.nasl");
      script_require_keys("Host/local_checks_enabled", "Host/cpu", "Host/SuSE/release", "Host/SuSE/rpm-list");
    
      exit(0);
    }
    
    
    include("global_settings.inc");
    include("rpm.inc");
    
    
    if (!get_kb_item("Host/local_checks_enabled")) exit(0, "Local checks are not enabled.");
    if (!get_kb_item("Host/SuSE/release")) exit(0, "The host is not running SuSE.");
    if (!get_kb_item("Host/SuSE/rpm-list")) exit(1, "Could not obtain the list of installed packages.");
    
    cpu = get_kb_item("Host/cpu");
    if (isnull(cpu)) exit(1, "Failed to determine the architecture type.");
    if (cpu >!< "x86_64" && cpu !~ "^i[3-6]86$") exit(1, "Local checks for SuSE 10 on the '"+cpu+"' architecture have not been implemented.");
    
    
    flag = 0;
    if (rpm_check(release:"SLED10", sp:1, reference:"nss_ldap-246-14.20")) flag++;
    if (rpm_check(release:"SLED10", sp:1, cpu:"x86_64", reference:"nss_ldap-32bit-246-14.20")) flag++;
    if (rpm_check(release:"SLES10", sp:1, reference:"nss_ldap-246-14.20")) flag++;
    if (rpm_check(release:"SLES10", sp:1, cpu:"x86_64", reference:"nss_ldap-32bit-246-14.20")) flag++;
    
    
    if (flag)
    {
      if (report_verbosity > 0) security_warning(port:0, extra:rpm_report_get());
      else security_warning(0);
      exit(0);
    }
    else exit(0, "The host is not affected.");
    
  • NASL familyDebian Local Security Checks
    NASL idDEBIAN_DSA-1430.NASL
    descriptionIt was reported that a race condition exists in libnss-ldap, an NSS module for using LDAP as a naming service, which could cause denial of service attacks if applications use pthreads. This problem was spotted in the dovecot IMAP/POP server but potentially affects more programs.
    last seen2020-06-01
    modified2020-06-02
    plugin id29338
    published2007-12-12
    reporterThis script is Copyright (C) 2007-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/29338
    titleDebian DSA-1430-1 : libnss-ldap - denial of service
  • NASL familySuSE Local Security Checks
    NASL idSUSE_NSS_LDAP-4773.NASL
    descriptionnss_ldap returned incorrect data under certain circumstances to the calling process. Some applications could therefore work with wrong user data (CVE-2007-5794).
    last seen2020-06-01
    modified2020-06-02
    plugin id30196
    published2008-02-06
    reporterThis script is Copyright (C) 2008-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/30196
    titleopenSUSE 10 Security Update : nss_ldap (nss_ldap-4773)
  • NASL familyScientific Linux Local Security Checks
    NASL idSL_20080724_NSS_LDAP_ON_SL4_X.NASL
    descriptionA race condition was discovered in nss_ldap, which affected certain applications that make LDAP connections, such as Dovecot. This could cause nss_ldap to answer a request for information about one user with the information about a different user. (CVE-2007-5794) As well, this updated package fixes the following bugs : - in certain situations, on Itanium(R) architectures, when an application performed an LDAP lookup for a highly populated group, for example, containing more than 150 members, the application crashed, or may have caused a segmentation fault. As well, this issue may have caused commands, such as
    last seen2020-06-01
    modified2020-06-02
    plugin id60452
    published2012-08-01
    reporterThis script is Copyright (C) 2012-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/60452
    titleScientific Linux Security Update : nss_ldap on SL4.x i386/x86_64
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2008-0389.NASL
    descriptionAn updated nss_ldap package that fixes a security issue and several bugs is now available. This update has been rated as having low security impact by the Red Hat Security Response Team. The nss_ldap package contains the nss_ldap and pam_ldap modules. The nss_ldap module is a plug-in which allows applications to retrieve information about users and groups from a directory server. The pam_ldap module allows PAM-aware applications to use a directory server to verify user passwords. A race condition was discovered in nss_ldap which affected certain applications which make LDAP connections, such as Dovecot. This could cause nss_ldap to answer a request for information about one user with information about a different user. (CVE-2007-5794) In addition, these updated packages fix the following bugs : * a build error prevented the nss_ldap module from being able to use DNS to discover the location of a directory server. For example, when the /etc/nsswitch.conf configuration file was configured to use
    last seen2020-06-01
    modified2020-06-02
    plugin id32426
    published2008-05-22
    reporterThis script is Copyright (C) 2008-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/32426
    titleRHEL 5 : nss_ldap (RHSA-2008:0389)
  • NASL familyGentoo Local Security Checks
    NASL idGENTOO_GLSA-200711-33.NASL
    descriptionThe remote host is affected by the vulnerability described in GLSA-200711-33 (nss_ldap: Information disclosure) Josh Burley reported that nss_ldap does not properly handle the LDAP connections due to a race condition that can be triggered by multi-threaded applications using nss_ldap, which might lead to requested data being returned to a wrong process. Impact : Remote attackers could exploit this race condition by sending queries to a vulnerable server using nss_ldap, possibly leading to theft of user credentials or information disclosure (e.g. Dovecot returning wrong mailbox contents). Workaround : There is no known workaround at this time.
    last seen2020-06-01
    modified2020-06-02
    plugin id28322
    published2007-11-26
    reporterThis script is Copyright (C) 2007-2019 Tenable Network Security, Inc.
    sourcehttps://www.tenable.com/plugins/nessus/28322
    titleGLSA-200711-33 : nss_ldap: Information disclosure
  • NASL familyRed Hat Local Security Checks
    NASL idREDHAT-RHSA-2008-0715.NASL
    descriptionAn updated nss_ldap package that fixes a security issue and several bugs is now available. This update has been rated as having low security impact by the Red Hat Security Response Team. The nss_ldap package contains the nss_ldap and pam_ldap modules. The nss_ldap module is a plug-in which allows applications to retrieve information about users and groups from a directory server. The pam_ldap module allows PAM-aware applications to use a directory server to verify user passwords. A race condition was discovered in nss_ldap, which affected certain applications that make LDAP connections, such as Dovecot. This could cause nss_ldap to answer a request for information about one user with the information about a different user. (CVE-2007-5794) As well, this updated package fixes the following bugs : * in certain situations, on Itanium(R) architectures, when an application performed an LDAP lookup for a highly populated group, for example, containing more than 150 members, the application crashed, or may have caused a segmentation fault. As well, this issue may have caused commands, such as
    last seen2020-06-01
    modified2020-06-02
    plugin id33583
    published2008-07-25
    reporterThis script is Copyright (C) 2008-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/33583
    titleRHEL 4 : nss_ldap (RHSA-2008:0715)
  • NASL familyMandriva Local Security Checks
    NASL idMANDRIVA_MDVSA-2008-049.NASL
    descriptionA race condition in nss_ldap, when used in applications that use pthread and fork after a call to nss_ldap, does not properly handle the LDAP connection, which might cause nss_ldap to return the wrong user data to the wrong process, giving one user access to data belonging to another user, in some cases. The updated package hais been patched to prevent this issue.
    last seen2020-06-01
    modified2020-06-02
    plugin id37403
    published2009-04-23
    reporterThis script is Copyright (C) 2009-2019 and is owned by Tenable, Inc. or an Affiliate thereof.
    sourcehttps://www.tenable.com/plugins/nessus/37403
    titleMandriva Linux Security Advisory : nss_ldap (MDVSA-2008:049)

Oval

accepted2013-04-29T04:07:11.908-04:00
classvulnerability
contributors
  • nameAharon Chernin
    organizationSCAP.com, LLC
  • nameDragos Prisaca
    organizationG2, Inc.
definition_extensions
  • commentThe operating system installed on the system is Red Hat Enterprise Linux 4
    ovaloval:org.mitre.oval:def:11831
  • commentCentOS Linux 4.x
    ovaloval:org.mitre.oval:def:16636
  • commentOracle Linux 4.x
    ovaloval:org.mitre.oval:def:15990
  • commentThe operating system installed on the system is Red Hat Enterprise Linux 5
    ovaloval:org.mitre.oval:def:11414
  • commentThe operating system installed on the system is CentOS Linux 5.x
    ovaloval:org.mitre.oval:def:15802
  • commentOracle Linux 5.x
    ovaloval:org.mitre.oval:def:15459
descriptionRace condition in nss_ldap, when used in applications that are linked against the pthread library and fork after a call to nss_ldap, might send user data to the wrong process because of improper handling of the LDAP connection. NOTE: this issue was originally reported for Dovecot with the wrong mailboxes being returned, but other applications might also be affected.
familyunix
idoval:org.mitre.oval:def:10625
statusaccepted
submitted2010-07-09T03:56:16-04:00
titleRace condition in nss_ldap, when used in applications that are linked against the pthread library and fork after a call to nss_ldap, might send user data to the wrong process because of improper handling of the LDAP connection. NOTE: this issue was originally reported for Dovecot with the wrong mailboxes being returned, but other applications might also be affected.
version27

Redhat

advisories
  • bugzilla
    id427370
    titleRHEL 5.1 nss_ldap does not build with RHEL 5.1 krb5 packages
    oval
    OR
    • commentRed Hat Enterprise Linux must be installed
      ovaloval:com.redhat.rhba:tst:20070304026
    • AND
      • commentRed Hat Enterprise Linux 5 is installed
        ovaloval:com.redhat.rhba:tst:20070331005
      • commentnss_ldap is earlier than 0:253-12.el5
        ovaloval:com.redhat.rhsa:tst:20080389001
      • commentnss_ldap is signed with Red Hat redhatrelease key
        ovaloval:com.redhat.rhsa:tst:20080389002
    rhsa
    idRHSA-2008:0389
    released2008-05-21
    severityLow
    titleRHSA-2008:0389: nss_ldap security and bug fix update (Low)
  • bugzilla
    id429101
    titledbus-daemon-1 hangs when using the option nss_initgroups_ignoreusers in /etc/ldap.conf with the user root
    oval
    OR
    • commentRed Hat Enterprise Linux must be installed
      ovaloval:com.redhat.rhba:tst:20070304026
    • AND
      • commentRed Hat Enterprise Linux 4 is installed
        ovaloval:com.redhat.rhba:tst:20070304025
      • commentnss_ldap is earlier than 0:253-5.el4
        ovaloval:com.redhat.rhsa:tst:20080715001
      • commentnss_ldap is signed with Red Hat master key
        ovaloval:com.redhat.rhsa:tst:20060719002
    rhsa
    idRHSA-2008:0715
    released2008-07-24
    severityLow
    titleRHSA-2008:0715: nss_ldap security and bug fix update (Low)
rpms
  • nss_ldap-0:253-12.el5
  • nss_ldap-debuginfo-0:253-12.el5
  • nss_ldap-0:253-5.el4
  • nss_ldap-debuginfo-0:253-5.el4

Seebug

bulletinFamilyexploit
descriptionBUGTRAQ ID: 26452 CVE(CAN) ID: CVE-2007-5794 nss_ldap模块可在AIX、Linux、Solaris等操作系统上提供LDAP名称服务交换服务。 如果应用程序链接到pthread并使用nss_ldap调用然后fork的话,这两个进程就会共享ldap连接,没有锁定机制。这可能导致通过共享的LDAP连接向进程返回错误数据。 这个漏洞的起因是当__pthread_once为非空就表示__pthread_atfork也为非空这个假设是错误的。这两个变量之间没有联系,调用pthread_atfork对nss_ldap中的__pthread_atfork值没有影响,反之亦然。 Padl Software nss_ldap &lt; Build 259 目前厂商已经发布了升级补丁以修复这个安全问题,请到厂商的主页下载: <a href="http://www.padl.com/download/nss_ldap.tgz" target="_blank">http://www.padl.com/download/nss_ldap.tgz</a>
idSSV:2433
last seen2017-11-19
modified2007-11-17
published2007-11-17
reporterRoot
titlePADL Nss_ldap竞争条件漏洞