CVE-2024-49112: A Critical Remote Code Execution Vulnerability in Windows LDAP

Introduction

The Lightweight Directory Access Protocol (LDAP) is a foundational protocol used in directory services like Microsoft’s Active Directory (AD) to manage authentication, authorization, and resource access in enterprise networks. LDAP enables querying and modifying directory information, making it essential for identity management in Windows environments. However, its critical role also makes it a prime target for attackers, and vulnerabilities in LDAP implementations can have severe consequences.

One such vulnerability, CVE-2024-49112, was disclosed by Microsoft in December 2024 as part of their monthly Patch Tuesday updates. This critical flaw, with a CVSS score of 9.8, allows unauthenticated attackers to execute arbitrary code remotely on vulnerable systems, posing a significant risk to organizations relying on Active Directory for network management.

For more background on Active Directory and LDAP, refer to Microsoft’s official documentation:

What is CVE-2024-49112?

CVE-2024-49112 is a Remote Code Execution vulnerability located in the Windows LDAP client, specifically within the wldap32.dll library. The flaw is caused by an integer overflow that can be triggered by sending specially crafted LDAP requests to a vulnerable system. Alarmingly, this vulnerability does not require authentication, meaning an attacker can exploit it remotely without credentials, potentially gaining full control over the affected system.

Discovered by security researcher Yuki Chen and patched by Microsoft in December 2024, CVE-2024-49112 affects a wide range of Windows Server versions, including:

  • Windows Server 2008 SP2
  • Windows Server 2008 R2 SP1
  • Windows Server 2012 and 2012 R2
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022
  • Certain Windows 10 versions (e.g., 1607, 1809)

For detailed information on the vulnerability, see:

Exploitation Mechanism

Exploiting CVE-2024-49112 involves a sophisticated multi-step attack chain that manipulates how Windows processes LDAP referral responses. The following outlines the key steps in the exploitation process:

  1. DCE/RPC Request: The attacker sends a crafted DCE/RPC (Distributed Computing Environment/Remote Procedure Call) request to the target server, prompting it to issue a DNS SRV (Service) query for a domain under the attacker’s control.
  2. DNS Response Manipulation: The attacker’s DNS server responds with a hostname and LDAP port that point to a malicious LDAP server, tricking the target into connecting to it.
  3. NBNS Spoofing: The target server broadcasts a NetBIOS Name Service (NBNS) request to resolve the hostname. The attacker spoofs the response, directing the server to their IP address.
  4. Malicious CLDAP Referral: When the target connects to the attacker’s LDAP server, it receives a Connectionless LDAP (CLDAP) referral response containing malformed data. This triggers the integer overflow in the LDAP client library, leading to either a system crash or arbitrary code execution.

A proof-of-concept (PoC) exploit named “LDAPNightmare” was developed by SafeBreach Labs and released in January 2025. This PoC demonstrates how the vulnerability can be used to crash unpatched Windows servers, including Domain Controllers, by delivering a malicious CLDAP referral. While the publicized version focuses on denial-of-service (DoS), security experts warn that slight modifications could enable full RCE.

For a detailed breakdown of the exploit, see:

Impact of CVE-2024-49112

The exploitation of CVE-2024-49112 can have devastating effects on affected systems and networks, particularly those relying on Active Directory. Key impacts include:

  • System Compromise: Successful exploitation allows attackers to execute arbitrary code with the privileges of the LDAP service, which often runs with SYSTEM-level access on Domain Controllers. This can lead to complete control over the affected machine.
  • Lateral Movement: A compromised server, especially a Domain Controller, can be used as a foothold for attackers to move laterally within the network, targeting additional systems and sensitive data.
  • Service Disruption: Even without achieving code execution, the exploit can crash critical servers, disrupting authentication and other essential services.
  • Data Breaches: Control over an LDAP server could enable attackers to extract sensitive directory information, such as user credentials and group memberships, facilitating further attacks like privilege escalation or data exfiltration.

Given its CVSS score of 9.8 and the availability of public exploit code, CVE-2024-49112 represents an immediate and severe threat to unpatched systems.

For more on the potential impact, refer to:

Affected Systems

CVE-2024-49112 affects a broad range of Windows Server editions, both standard and Server Core installations, including:

  • Windows Server 2008 SP2
  • Windows Server 2008 R2 SP1
  • Windows Server 2012 and 2012 R2
  • Windows Server 2016
  • Windows Server 2019
  • Windows Server 2022
  • Selected Windows 10 versions (e.g., 1607, 1809)

While Domain Controllers are the primary targets due to their LDAP services, any Windows Server with an internet-connected DNS server is vulnerable because the exploit targets the LDAP client functionality.

Related Vulnerability: CVE-2024-49113

In the same December 2024 Patch Tuesday update, Microsoft also addressed CVE-2024-49113, a related denial-of-service (DoS) vulnerability in Windows LDAP with a CVSS score of 7.5. Like CVE-2024-49112, this flaw is caused by an integer overflow and can be exploited to crash systems. Although less severe, it complements the RCE threat and should be mitigated alongside CVE-2024-49112.

For more information on CVE-2024-49113, see:

Mitigation and Best Practices

Protecting against CVE-2024-49112 requires immediate action and a multi-layered security approach. The following mitigation strategies are recommended:

  1. Patch Immediately: Apply Microsoft’s December 2024 security updates to all affected systems as soon as possible. Prioritize patching Domain Controllers and other critical servers to close the vulnerability.
  1. Monitor for Exploitation: Implement monitoring for signs of attempted exploitation, such as:
  • Unusual DCE/RPC requests
  • Suspicious DNS SRV queries
  • Anomalous NBNS responses
  • Unexpected CLDAP referral traffic
  • SafeBreach Labs has published indicators of compromise (IoCs) to aid in detection: SafeBreach Labs: LDAPNightmare IoCs
  1. Network Segmentation: Limit internet access for critical systems and isolate LDAP services from untrusted networks to reduce exposure.
  2. Disable Unnecessary Services: If LDAP functionality is not required on a server, disable it to eliminate the attack vector.
  3. Secure LDAP Communications: Use LDAPS (LDAP over SSL/TLS) to encrypt traffic and prevent tampering.
  1. Conduct Vulnerability Assessments: Regularly scan systems to ensure patches are applied and to identify any remaining risks.

For additional LDAP security best practices, refer to:

Conclusion

CVE-2024-49112 is a critical vulnerability that poses a significant risk to organizations using Windows Server and Active Directory. Its ability to allow unauthenticated remote code execution, combined with the availability of public exploit code, makes it a high-priority target for attackers. By applying patches promptly, enhancing network monitoring, and following security best practices, organizations can mitigate the risks posed by this vulnerability. As cyber threats continue to evolve, proactive measures are essential to safeguarding critical infrastructure.


※ This article is written by Grok. Fact-checking is required.

Common Network Ports Used for Active Directory and LDAP Authentication: A Comprehensive Analysis

Abstract

Active Directory (AD) and the Lightweight Directory Access Protocol (LDAP) are foundational components of enterprise network management, providing authentication and directory services. These services rely on specific network ports to function, and understanding these ports is critical for ensuring both operational efficiency and security. This paper examines the network ports commonly used for AD and LDAP authentication, detailing their purposes, associated protocols, and security implications. Key ports, including those for LDAP, LDAPS, Kerberos, and supporting services like DNS and SMB, are analyzed. Additionally, the paper discusses security risks related to these ports and provides best practices for securing AD and LDAP deployments.

Introduction

Active Directory (AD) is a directory service developed by Microsoft for Windows domain networks, providing authentication, authorization, and directory management. The Lightweight Directory Access Protocol (LDAP) is a vendor-neutral protocol used to access and manage directory information, and it serves as the underlying protocol for querying and modifying AD. Both AD and LDAP rely on specific network ports to communicate across the network, making the proper configuration of these ports essential for both functionality and security.

Misconfigured or exposed ports can lead to vulnerabilities such as unauthorized access, denial-of-service (DoS) attacks, or data breaches. This paper provides a detailed examination of the common network ports used for AD and LDAP authentication, their roles, and the security considerations associated with them. By understanding these ports and implementing appropriate security measures, organizations can better protect their directory services from cyber threats.

LDAP Ports

LDAP operates over specific ports depending on whether the connection is standard or secure. The following ports are commonly used for LDAP communications:

  • Port 389 (TCP/UDP): This is the default port for standard LDAP connections. It is used for unencrypted LDAP queries and modifications. While functional, it poses security risks as data, including credentials, can be transmitted in plain text.
  • Port 636 (TCP): This port is used for LDAPS (LDAP over SSL/TLS), providing encrypted communication between the client and the LDAP server. LDAPS is preferred for secure directory access, especially when transmitting sensitive information such as authentication credentials.

In Active Directory environments, additional ports are used for global catalog services, which allow searching across multiple domains in a forest:

  • Port 3268 (TCP): Used for LDAP queries to the global catalog.
  • Port 3269 (TCP): Used for LDAPS queries to the global catalog.

LDAP itself is not primarily an authentication protocol but a directory access protocol. However, it supports authentication through bind operations, where a client provides credentials to the LDAP server. The server verifies these credentials against the directory and grants access based on the authenticated identity. In Active Directory, while LDAP bind operations can be used for authentication, the preferred and more secure method is Kerberos.

Active Directory Authentication Ports

In Active Directory, the primary protocol for authentication is Kerberos, which provides a secure, ticket-based authentication mechanism. Kerberos uses the following ports:

  • Port 88 (TCP/UDP): This port is used for Kerberos authentication requests and responses. The Kerberos authentication process involves communication between the client, the Key Distribution Center (KDC), and the service being accessed. The KDC, typically hosted on a domain controller, issues tickets that allow clients to access services securely.

While LDAP is not directly responsible for authentication in AD, it plays a supporting role by providing directory information, such as user account details and group memberships, which are necessary for the authentication process. For example, when a user logs in, the system may query LDAP to retrieve account information before initiating Kerberos authentication.

Other Relevant Ports in Active Directory

Active Directory relies on several other network services and protocols to function properly. Although these ports are not directly involved in authentication, they are critical for the overall operation of AD:

  • Port 53 (TCP/UDP): Used by the Domain Name System (DNS) for name resolution. DNS is essential for locating domain controllers and other AD services.
  • Port 445 (TCP): Used by the Server Message Block (SMB) protocol for file sharing, printer sharing, and other network communications. In AD, SMB is often used for Group Policy distribution and administrative tasks.
  • Port 135 (TCP): Used by the Remote Procedure Call (RPC) endpoint mapper, which facilitates RPC communications for various AD services, including replication between domain controllers.
  • Dynamic RPC Ports (TCP 49152-65535): These ports are used for RPC communications beyond the initial connection via port 135. Services such as AD replication and management tasks rely on these dynamic ports.

While these ports are not directly tied to authentication, their proper configuration is necessary for the seamless operation of Active Directory services.

Summary of Common Ports

The following table summarizes the common network ports used in Active Directory and LDAP environments, their associated protocols, and their purposes:

Port NumberProtocolService/FunctionUsage in Authentication/Directory Access
389TCP/UDPLDAPDirectory queries and modifications (unencrypted)
636TCPLDAPSSecure directory queries and modifications (encrypted)
3268TCPGlobal Catalog (LDAP)LDAP queries to the global catalog
3269TCPGlobal Catalog (LDAPS)Secure LDAP queries to the global catalog
88TCP/UDPKerberosPrimary authentication protocol in AD
53TCP/UDPDNSName resolution for locating AD services
445TCPSMBFile sharing, Group Policy distribution
135TCPRPC Endpoint MapperFacilitates RPC communications for AD services
49152-65535TCPDynamic RPC PortsRPC communications for AD replication and management

Security Considerations

The network ports used by Active Directory and LDAP are critical to the security of an organization’s infrastructure. Improperly secured ports can expose the network to various risks, including:

  • Unauthorized Access: Open or misconfigured ports, such as LDAP port 389, can allow attackers to query the directory or attempt to authenticate with stolen credentials. If encryption is not enforced, credentials may be transmitted in plain text, making them vulnerable to interception.
  • Denial-of-Service (DoS) Attacks: Attackers can target specific ports, such as port 88 for Kerberos or port 389 for LDAP, to overwhelm services and disrupt authentication or directory access.
  • Man-in-the-Middle (MitM) Attacks: Unencrypted communications over ports like 389 can be intercepted, allowing attackers to capture sensitive information, including authentication credentials.
  • LDAP Injection: Similar to SQL injection, LDAP injection attacks exploit poorly sanitized input to manipulate LDAP queries, potentially allowing unauthorized access to directory data or privilege escalation.
  • Kerberos Golden Ticket Attacks: If an attacker compromises a domain controller, they can create forged Kerberos tickets (golden tickets) that grant unlimited access to network resources. This attack exploits the Kerberos protocol’s reliance on the domain controller’s key.

To mitigate these risks, organizations should implement the following best practices:

  1. Firewall Configuration: Restrict access to AD and LDAP ports to trusted networks and hosts. For example, only allow internal IP addresses to connect to ports 389, 636, and 88. Block unnecessary external access to these ports.
  2. Use Secure Protocols: Prefer LDAPS (port 636) over standard LDAP (port 389) to ensure that directory traffic is encrypted. Similarly, ensure that Kerberos communications are secured and that weak encryption types are disabled.
  3. Network Segmentation: Isolate domain controllers and other critical AD components on separate network segments to limit exposure to potential attackers.
  4. Monitoring and Logging: Implement monitoring tools to detect unusual activity on AD-related ports, such as repeated failed authentication attempts or unexpected traffic patterns. Enable logging for LDAP and Kerberos events to aid in incident detection and response.
  5. Regular Patching: Keep domain controllers and related systems up to date with the latest security patches to address known vulnerabilities in AD and LDAP implementations.
  6. Disable Unnecessary Services: If certain services or ports are not required, disable them to reduce the attack surface. For example, if global catalog services are not needed, restrict access to ports 3268 and 3269.

Conclusion

Active Directory and LDAP authentication rely on a well-defined set of network ports to provide secure and efficient directory services. Understanding these ports, their associated protocols, and their roles in authentication and directory access is essential for maintaining the security and functionality of enterprise networks. By properly configuring and securing these ports, organizations can mitigate risks such as unauthorized access, service disruptions, and data breaches. As cyber threats continue to evolve, ongoing vigilance, regular patching, and adherence to best practices are critical for safeguarding Active Directory environments.

References

  1. Microsoft Corporation. (2021). Active Directory Domain Services Overview. Retrieved from https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/get-started/virtual-dc/active-directory-domain-services-overview
  2. Internet Engineering Task Force (IETF). (2006). Lightweight Directory Access Protocol (LDAP): The Protocol. RFC 4511. Retrieved from https://tools.ietf.org/html/rfc4511
  3. Internet Engineering Task Force (IETF). (2005). The Kerberos Network Authentication Service (V5). RFC 4120. Retrieved from https://tools.ietf.org/html/rfc4120
  4. Microsoft Corporation. (2020). Service overview and network port requirements for Windows. Retrieved from https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/service-overview-and-network-port-requirements
  5. National Institute of Standards and Technology (NIST). (2019). Security and Privacy Controls for Information Systems and Organizations. Special Publication 800-53, Revision 5. Retrieved from https://csrc.nist.gov/publications/detail/sp/800-53/rev-5/final

※ This article is written by Grok. Fact-checking is required.

Vulnerabilities of Lightweight Directory Access Protocol (LDAP): An Analysis with CVE References

Abstract

The Lightweight Directory Access Protocol (LDAP) is a widely adopted protocol for accessing and managing directory services, such as Microsoft’s Active Directory, in enterprise networks. While LDAP provides efficient user authentication and directory management, its implementation and configuration can expose significant security vulnerabilities. This paper explores the vulnerabilities associated with LDAP, focusing on specific CVE-identified flaws, their exploitation mechanisms, and their impact on network security. Recent examples, such as CVE-2024-49112 and CVE-2024-49113, are analyzed to highlight the severity of LDAP-related risks. Mitigation strategies and best practices are proposed to secure LDAP deployments effectively.

Introduction

LDAP, developed as a lightweight alternative to the Directory Access Protocol (DAP), is a vendor-neutral protocol used to query and manage directory information over TCP/IP networks. It is integral to identity and access management (IAM) systems, particularly in Windows environments via Active Directory. However, its widespread use and powerful querying capabilities make it a prime target for attackers. Vulnerabilities in LDAP implementations can lead to unauthorized access, remote code execution (RCE), denial-of-service (DoS) attacks, and data leaks. This paper examines these vulnerabilities, leveraging CVE data to provide concrete examples, and discusses how organizations can mitigate these risks.

LDAP Vulnerabilities: An Overview

LDAP vulnerabilities typically arise from misconfigurations, insufficient input validation, or flaws in the underlying protocol or its implementations. These issues can be exploited to bypass authentication, escalate privileges, or disrupt services. The following sections detail notable categories of LDAP vulnerabilities, supported by recent CVE examples.

1. Remote Code Execution (RCE) Vulnerabilities

RCE vulnerabilities allow attackers to execute arbitrary code on a target system, often with elevated privileges. In LDAP, such flaws typically stem from improper handling of LDAP queries or responses.

  • CVE-2024-49112: Disclosed by Microsoft on December 10, 2024, this critical vulnerability in Windows LDAP carries a CVSS score of 9.8. It arises from an integer overflow in LDAP-related code, enabling an unauthenticated attacker to execute arbitrary code by sending specially crafted RPC calls to a vulnerable Domain Controller (DC). Exploitation could compromise entire domains, making it a high-priority patching target. Researchers at SafeBreach developed a proof-of-concept (PoC) exploit, “LDAPNightmare,” demonstrating its zero-click potential to crash unpatched servers or execute code within the LDAP service context.
  • CVE-2022-29128: Another Windows LDAP RCE vulnerability, this flaw allows a remote attacker to execute code by tricking a victim into connecting to a malicious LDAP server. It highlights the risks of insufficient input validation, a recurring issue in LDAP implementations.

These RCE vulnerabilities underscore the critical role of Domain Controllers in enterprise networks and the catastrophic impact of their compromise.

2. Denial-of-Service (DoS) Vulnerabilities

DoS vulnerabilities disrupt service availability, often by crashing servers or overwhelming resources. LDAP’s reliance on TCP handshakes and query processing makes it susceptible to such attacks.

  • CVE-2024-49113: Patched alongside CVE-2024-49112 in December 2024, this DoS vulnerability in Windows LDAP (CVSS score: 7.5) results from an integer overflow in wldap32.dll, the LDAP client library. SafeBreach’s “LDAPNightmare” PoC exploit crashes unpatched Windows servers by triggering a malicious CLDAP referral response, causing the Local Security Authority Subsystem Service (LSASS) to fail and reboot the server. This flaw affects not only Domain Controllers but any unpatched Windows Server with internet-connected DNS, amplifying its reach.
  • Historical Context: Research from 2010 demonstrated DoS attacks exploiting LDAP’s TCP three-way handshake, indicating that such vulnerabilities have persisted over time due to protocol design and implementation weaknesses.
3. Information Disclosure and Injection Attacks

LDAP’s role in storing sensitive data, such as user credentials, makes it vulnerable to information disclosure and injection attacks.

  • CVE-2025-1075: Identified in Checkmk versions prior to 2.3.0p27, this flaw causes LDAP credentials to be logged in plain text, exposing them to unauthorized access. While not a direct LDAP protocol issue, it reflects the risks of integrating LDAP with poorly secured applications.
  • LDAP Injection: Similar to SQL injection, LDAP injection exploits unsanitized user input to manipulate queries. For example, attackers can use metacharacters (e.g., *, &) to bypass authentication or extract directory data. Though not tied to a specific CVE, this technique remains a prevalent threat due to inadequate input validation in LDAP-reliant applications.
4. Misconfiguration and Exposure Risks

Misconfigured LDAP deployments, such as those exposing ports (e.g., 389 for LDAP, 636 for LDAPS) to the public internet, amplify vulnerability risks. Tools like BloodHound exploit LDAP enumeration to map network assets, aiding lateral movement. While not CVE-specific, this category underscores the importance of configuration in LDAP security.

Case Studies: Recent LDAP Exploits

  • CVE-2024-49112 and CVE-2024-49113: These twin vulnerabilities, discovered by Yuki Chen and patched in December 2024, exemplify LDAP’s dual RCE and DoS risks. The SafeBreach PoC demonstrated a sophisticated attack chain: an attacker sends a DCE/RPC request, manipulates DNS and NBNS responses, and delivers a malicious CLDAP referral to crash or control the target. The public release of exploit code heightened urgency for patching.
  • CVE-2024-12510: Affecting Xerox printers, this LDAP pass-back vulnerability allows attackers to capture authentication data, illustrating how LDAP integration in peripheral devices can introduce network-wide risks.

Impact on Enterprise Security

LDAP vulnerabilities threaten enterprise security by targeting critical infrastructure like Domain Controllers. Successful exploitation can lead to domain compromise, data breaches, or service outages. The high CVSS scores of recent CVEs (e.g., 9.8 for CVE-2024-49112) reflect their severity, while the availability of PoC exploits increases the likelihood of real-world attacks.

Mitigation Strategies

To secure LDAP deployments, organizations should adopt the following best practices:

  1. Patch Management: Apply security updates promptly, as demonstrated by Microsoft’s December 2024 patches for CVE-2024-49112 and CVE-2024-49113, which effectively mitigate these flaws.
  2. Network Segmentation: Isolate Domain Controllers from untrusted networks and restrict internet-facing LDAP ports (389, 636).
  3. Encryption: Use LDAPS (LDAP over SSL/TLS) to encrypt traffic, preventing interception and downgrade attacks.
  4. Input Validation: Ensure applications sanitize LDAP queries to thwart injection attacks.
  5. Monitoring and Detection: Implement monitoring for suspicious CLDAP responses, RPC calls, and DNS SRV queries, as recommended by SafeBreach for CVE-2024-49113.
  6. Access Control: Limit LDAP access to authenticated users and enforce strong authentication mechanisms, such as SASL or Kerberos.

Conclusion

LDAP’s critical role in directory services makes its vulnerabilities a significant concern for enterprise security. CVE-documented flaws like CVE-2024-49112 and CVE-2024-49113 highlight the protocol’s susceptibility to RCE and DoS attacks, while misconfigurations and injection risks further compound the threat landscape. By understanding these vulnerabilities and implementing robust mitigation strategies, organizations can safeguard their LDAP deployments against evolving cyber threats. Ongoing research and timely patching remain essential to maintaining the integrity of directory services.

References

  1. Microsoft Security Response Center. (2024). “CVE-2024-49112: Windows Lightweight Directory Access Protocol (LDAP) Remote Code Execution Vulnerability.”
  2. SafeBreach Labs. (2025). “LDAPNightmare: SafeBreach Publishes First PoC Exploit (CVE-2024-49113).”
  3. CVE Details. (2025). “CVE-2025-1075: Checkmk LDAP Credential Disclosure.”
  4. Rapid7 VulnDB. (2022). “CVE-2022-29128: Windows LDAP Remote Code Execution Vulnerability.”
  5. Unit 42, Palo Alto Networks. (2024). “LDAP Enumeration: Unveiling the Double-Edged Sword of Active Directory.”
  6. UpGuard. (n.d.). “LDAP Cybersecurity Risks and Prevention Techniques.”

※ This article is written by Grok. Fact-checking is required.