CVE-2023-35365
CVE-2023-35365
Weakness (CWE)
CVSS Vector
v3.1- Attack Vector
- Network
- Attack Complexity
- Low
- Privileges Required
- None
- User Interaction
- None
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
Description
Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
Comprehensive Technical Analysis of CVE-2023-35365
Windows Routing and Remote Access Service (RRAS) Remote Code Execution Vulnerability
1. Vulnerability Assessment and Severity Evaluation
CVE ID: CVE-2023-35365 CVSS v3.1 Score: 9.8 (Critical) Vector: AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Severity Breakdown:
- Attack Vector (AV:N): Network-based exploitation (remote attack surface).
- Attack Complexity (AC:L): Low complexity; no special conditions required.
- Privileges Required (PR:N): No privileges needed (unauthenticated attacker).
- User Interaction (UI:N): No user interaction required.
- Scope (S:U): Unchanged (impact confined to the vulnerable component).
- Confidentiality (C:H), Integrity (I:H), Availability (A:H): High impact across all three security objectives.
Vulnerability Classification:
- Type: Remote Code Execution (RCE) via memory corruption or improper input validation.
- Root Cause: Likely a buffer overflow, use-after-free, or integer overflow in the RRAS service, allowing arbitrary code execution in the context of the SYSTEM account (highest privilege level in Windows).
Exploitability Assessment:
- Exploit Code Maturity: Likely to be weaponized quickly due to:
- No authentication required.
- Network accessibility (RRAS is often exposed in enterprise environments).
- High potential for wormable exploitation (self-propagating malware).
- Public Exploits: As of the latest assessment, no public Proof-of-Concept (PoC) exploits have been confirmed, but historical trends suggest rapid development post-disclosure.
2. Potential Attack Vectors and Exploitation Methods
Primary Attack Vectors:
-
Direct Network Exploitation:
- Attackers send specially crafted packets to the RRAS service (TCP/UDP ports 1723, 47, 50, 500, 4500, etc.) to trigger the vulnerability.
- Likely involves malformed PPTP, L2TP, IKEv2, or SSTP protocol packets.
-
Man-in-the-Middle (MitM) Attacks:
- If RRAS is used for VPN termination, an attacker could intercept and modify traffic to exploit the flaw.
-
Lateral Movement & Wormable Exploitation:
- Once compromised, the attacker could use the RCE to propagate malware across internal networks (similar to EternalBlue or BlueKeep).
Exploitation Methods:
-
Memory Corruption (Heap/Stack Overflow):
- The RRAS service may improperly handle input validation, leading to arbitrary memory writes.
- Example: A malformed PPTP control message could overwrite a function pointer or return address.
-
Use-After-Free (UAF):
- If RRAS fails to properly manage object lifetimes, an attacker could reuse freed memory to execute arbitrary code.
-
Integer Overflow/Underflow:
- Incorrect handling of packet lengths or counters could lead to buffer overflows.
Post-Exploitation Impact:
- Privilege Escalation: Since RRAS runs as SYSTEM, successful exploitation grants full control over the host.
- Persistence: Attackers could install backdoors, modify registry keys, or deploy ransomware.
- Data Exfiltration: Sensitive data (VPN credentials, network configurations) could be stolen.
- Network Pivoting: Compromised RRAS servers could be used as a foothold for lateral movement.
3. Affected Systems and Software Versions
Confirmed Vulnerable Systems:
- Windows Server 2012 R2 (including Core installations)
- Windows Server 2016 (including Core installations)
- Windows Server 2019 (including Core installations)
- Windows Server 2022 (including Core installations)
- Windows 10/11 (if RRAS is manually enabled, though less common)
Non-Affected Systems:
- Systems where RRAS is disabled (default on most client Windows versions).
- Windows Server versions prior to 2012 R2 (RRAS implementation differs).
- Azure-based RRAS deployments (unless using on-premises RRAS in hybrid setups).
Detection Methods:
- Network Scanning:
- Identify hosts with RRAS ports (1723, 47, 50, 500, 4500) open.
- Use Nmap with service detection:
nmap -sV -p 1723,47,50,500,4500 <target_IP>
- Endpoint Detection:
- Check if Routing and Remote Access Service is running:
Get-Service -Name RemoteAccess | Select-Object Status, StartType - Verify installed patches via Windows Update History or PowerShell:
Get-HotFix | Where-Object { $_.HotFixID -eq "KB5028166" } # Example KB for July 2023
- Check if Routing and Remote Access Service is running:
4. Recommended Mitigation Strategies
Immediate Actions:
-
Apply Microsoft’s Security Update (KB5028166 or later):
- Critical: Deploy the patch immediately via Windows Update, WSUS, or SCCM.
- Manual Download: Microsoft Update Catalog.
-
Disable RRAS if Not Required:
- PowerShell Command:
Stop-Service -Name RemoteAccess -Force Set-Service -Name RemoteAccess -StartupType Disabled - GUI Method:
- Open Services.msc → Stop and disable Routing and Remote Access.
- PowerShell Command:
-
Network-Level Protections:
- Firewall Rules:
- Block inbound traffic to RRAS ports (1723, 47, 50, 500, 4500) from untrusted networks.
- Use Windows Firewall or network perimeter firewalls (e.g., Palo Alto, Fortinet).
- VPN Hardening:
- Enforce IKEv2 with IPSec (more secure than PPTP/L2TP).
- Disable PPTP (inherently insecure).
- Firewall Rules:
-
Segmentation & Zero Trust:
- Isolate RRAS servers in a DMZ with strict access controls.
- Implement Network Access Control (NAC) to limit VPN connections to authorized devices.
-
Monitoring & Detection:
- SIEM Alerts:
- Monitor for unusual RRAS service restarts (indicative of crash exploitation).
- Detect anomalous VPN connection attempts (e.g., brute-force, malformed packets).
- Endpoint Detection & Response (EDR):
- Use Microsoft Defender for Endpoint, CrowdStrike, or SentinelOne to detect post-exploitation activity.
- Network Traffic Analysis (NTA):
- Deploy Zeek (Bro), Suricata, or Darktrace to inspect RRAS traffic for exploitation attempts.
- SIEM Alerts:
Long-Term Mitigations:
- Regular Vulnerability Scanning:
- Use Nessus, Qualys, or OpenVAS to detect unpatched RRAS instances.
- Least Privilege Principle:
- Restrict RRAS service accounts to minimum required permissions.
- VPN Modernization:
- Migrate from RRAS to Azure VPN Gateway or third-party solutions (e.g., OpenVPN, WireGuard).
- Patch Management Automation:
- Implement automated patching (e.g., Windows Update for Business, Ansible, or Chef).
5. Impact on the Cybersecurity Landscape
Strategic Implications:
-
Enterprise Risk:
- RRAS is widely used in enterprise VPNs, remote access, and site-to-site connectivity, making this a high-value target for APT groups and ransomware operators.
- Wormable potential (similar to EternalBlue) could lead to rapid, large-scale infections.
-
Threat Actor Interest:
- State-Sponsored Groups (e.g., APT29, Lazarus): Likely to exploit for espionage.
- Ransomware Gangs (e.g., LockBit, BlackCat): Could use for initial access and lateral movement.
- Cybercriminals: May develop exploit kits for mass exploitation.
-
Compliance & Regulatory Impact:
- Failure to patch may violate NIST SP 800-53, ISO 27001, or CIS Controls.
- GDPR, HIPAA, or PCI DSS penalties if exploited to exfiltrate sensitive data.
Historical Context:
- Similar Vulnerabilities:
- CVE-2021-31181 (Windows DNS Server RCE) – Critical, network-based RCE.
- CVE-2020-0796 (SMBGhost) – Wormable RCE in SMBv3.
- CVE-2019-0708 (BlueKeep) – Remote Desktop (RDP) RCE.
- Lessons Learned:
- Unpatched RRAS servers are a frequent attack vector (e.g., Ryuk ransomware).
- Zero-day exploits for RRAS have been observed in the wild (e.g., APT29’s use of CVE-2021-26897).
6. Technical Details for Security Professionals
Root Cause Analysis (Hypothetical):
While Microsoft has not released full technical details, based on historical RRAS vulnerabilities, the flaw likely stems from:
- Improper Input Validation in PPTP/L2TP/IKEv2 Parsing:
- The RRAS service may fail to validate packet lengths, headers, or encryption parameters, leading to buffer overflows.
- Use-After-Free in Connection Handling:
- If RRAS improperly manages VPN session objects, an attacker could trigger a UAF to gain arbitrary code execution.
- Integer Overflow in Memory Allocation:
- A malformed packet could cause an integer overflow in memory allocation, leading to a heap overflow.
Exploitation Flow (Theoretical):
- Reconnaissance:
- Attacker scans for open RRAS ports (1723, 500, etc.) using Nmap or Masscan.
- Exploit Delivery:
- Attacker sends a crafted PPTP control message with an oversized or malformed payload.
- Memory Corruption:
- The RRAS service processes the packet, leading to a stack/heap overflow or UAF.
- Arbitrary Code Execution:
- The attacker overwrites a function pointer or return address, redirecting execution to shellcode.
- Post-Exploitation:
- Attacker gains SYSTEM privileges, deploys malware, or moves laterally.
Detection & Forensics:
- Memory Forensics (Volatility):
- Check for unusual process memory in
RemoteAccess.exe:volatility -f memory.dmp --profile=Win10x64_19041 malfind -p <PID>
- Check for unusual process memory in
- Network Forensics (Wireshark):
- Look for malformed PPTP/L2TP packets with unusual lengths or flags.
- Example Wireshark filter:
pptp || l2tp || ikev2 && (ip.len > 1500 || tcp.flags.syn == 1 && tcp.flags.ack == 0)
- Endpoint Logs:
- Windows Event Logs (Event ID 4688, 4672) for suspicious
RemoteAccess.exechild processes. - Sysmon (Event ID 1) for unusual process creation.
- Windows Event Logs (Event ID 4688, 4672) for suspicious
Proof-of-Concept (PoC) Considerations:
- Reverse Engineering:
- Use Ghidra or IDA Pro to analyze
rasmans.dll(RRAS core library). - Look for unsafe functions (
strcpy, memcpy, sprintf) or custom packet parsers.
- Use Ghidra or IDA Pro to analyze
- Fuzzing:
- Tools like Boofuzz or AFL could be used to identify crash conditions in RRAS.
- Exploit Development:
- If a heap overflow is confirmed, techniques like Heap Feng Shui may be required.
- For UAF, heap spraying could be used to control freed memory.
Conclusion & Recommendations
CVE-2023-35365 represents a critical, remotely exploitable RCE vulnerability in a widely deployed Windows service. Given its CVSS 9.8 score, unauthenticated attack vector, and potential for wormable exploitation, organizations must prioritize patching and implement defensive measures immediately.
Key Takeaways for Security Teams:
✅ Patch Immediately – Deploy KB5028166 (or later) without delay. ✅ Disable RRAS if Unused – Reduce attack surface where possible. ✅ Segment & Monitor – Isolate RRAS servers and deploy NTA/EDR for detection. ✅ Prepare for Exploitation – Assume APT and ransomware groups will target this flaw. ✅ Hunt for IOCs – Monitor for unusual RRAS crashes, VPN anomalies, or SYSTEM-level process execution.
Final Risk Assessment:
| Factor | Risk Level | Justification |
|---|---|---|
| Exploitability | Critical | Unauthenticated, network-based, low complexity. |
| Impact | Critical | Full SYSTEM compromise, data theft, lateral movement. |
| Likelihood of Exploit | High | Historical trends show rapid weaponization. |
| Mitigation Feasibility | High | Patch available, workarounds effective. |
Action Priority: URGENT (PATCH WITHIN 7 DAYS) – This vulnerability is expected to be actively exploited in the wild.