TLS certificate identity validation accepts malformed server names in FreeRDP
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Spoofing
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-295.
Summary
FreeRDP through 3.28.0 accepts TLS server certificates whose identity checks are wrong, because its custom Common Name and DNS SAN matching does not use OpenSSL's length-aware validation. A DNS SAN with an embedded NUL byte is truncated before matching, so a name such as victim.example followed by a NUL and another domain is accepted as victim.example. A matching Common Name is also accepted even when DNS SAN entries are present and do not match. An attacker who holds a certificate issued by a trusted CA, or a private CA, can impersonate another server, and no memory corruption or code execution is claimed.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
Description from the GitHub advisory
### Summary Thank you for maintaining FreeRDP. The findings in this report, together with my previous FreeRDP reports, come from my defensive vulnerability research project at UESTC. This is a follow-up to the already accepted FreeRDP wildcard hostname advisory `GHSA-5wr6-8m8j-3h7f`. I found three additional certificate identity validation inconsistencies in the same FreeRDP TLS verification area. All three reproduce in the production FreeRDP TLS handshake path with: - a local trusted test CA installed into an isolated FreeRDP certificate store, - `AutoAcceptCertificate = FALSE`, - `AutoDenyCertificate = TRUE`, - `AuthenticationLevel = 2`. No memory corruption, code execution, or direct credential extraction is claimed. The impact is weakened TLS server authentication in trusted-CA, private-CA, or certificate misissuance scenarios. Affected code: - `libfreerdp/crypto/tls.c:tls_verify_certificate()` - `libfreerdp/crypto/tls.c:tls_match_hostname()` - `libfreerdp/crypto/x509_utils.c:x509_utils_get_dns_names()` The common root theme is that FreeRDP performs custom Common Name and DNS SAN string matching instead of using OpenSSL's length-aware identity validation APIs for DNS names and IP literals. ## Case 1: DNS SAN embedded-NUL truncation `x509_utils_get_dns_names()` obtains DNS SAN values with `ASN1_STRING_to_UTF8()` but stores each SAN length with `strlen()`: ```c result[i] = list.strings[i]; (*lengths)[i] = strlen(result[i]); ``` If a DNSName contains an embedded NUL byte, FreeRDP truncates the logical name before matching it. A raw DNSName of: ```text victim.example\0.attacker.example ``` is treated as `victim.example` by FreeRDP. Latest upstream result, re-run after confirming `origin/master == b9533f07f98c25ed01c5f543b4d0ce73e120f5fd`: ```text dns_san_len=32 dns_san_hex=76696374696d2e6578616d706c65002e61747461636b65722e6578616d706c65 case host=victim.example freerdp_tls_result=0 server_done=1 openssl_x509_check_host=0 openssl_x509_check_ip_asc=-2 ``` Negative control on latest upstream: ```text case host=attacker.example freerdp_tls_result=3 server_done=1 openssl_x509_check_host=0 openssl_x509_check_ip_asc=-2 ``` This confirms the positive case is caused by FreeRDP's NUL-truncated `victim.example` prefix, not blanket certificate acceptance. ## Case 2: Common Name accepted even when DNS SAN is present and non-matching `tls_verify_certificate()` checks the Common Name before checking DNS SAN values. A matching CN is sufficient even when DNS SAN entries are present and non-matching. The generated leaf certificate has: ```text CN=victim.example DNS:ignored.invalid ``` Latest upstream result, re-run after confirming `origin/master == b9533f07f98c25ed01c5f543b4d0ce73e120f5fd`: ```text dns_san_len=15 dns_san_hex=69676e6f7265642e696e76616c6964 case host=victim.example freerdp_tls_result=0 server_done=1 openssl_x509_check_host=0 openssl_x509_check_ip_asc=-2 ``` OpenSSL rejects the same certificate for `victim.example`; FreeRDP accepts it because the Common Name matches. ## Case 3: IP-literal target accepted through DNS SAN despite non-matching iPAddress SAN For IP-literal connection targets, FreeRDP compares the target string against Common Name and DNS SAN values with `tls_match_hostname()`. The verifier does not extract or compare `GEN_IPADD` / iPAddress SAN entries and does not select an IP-specific verification path. The generated leaf certificate contains: ```text DNS:192.0.2.10 IP Address:203.0.113.55 ``` Latest upstream result, re-run after confirming `origin/master == b9533f07f98c25ed01c5f543b4d0ce73e120f5fd`: ```text dns_san_len=10 dns_san_hex=3139322e302e322e3130 ip_san_len=4 ip_san_hex=cb007137 case host=192.0.2.10 freerdp_tls_result=0 server_done=1 openssl_x509_check_host=1 openssl_x509_check_ip_asc=0 ``` `dns_san_hex` decodes to `192.0.2.10`; `ip_san_hex=cb007137` decodes to `203.0.113.55`. OpenSSL's IP-specific verifier rejects the certificate for `192.0.2.10`, while FreeRDP accepts it. ## Impact All three cases weaken TLS server identity validation under a trusted certificate chain. They are most relevant in: - enterprise or private-CA environments, - certificate misissuance scenarios, - deployments relying on strict FreeRDP certificate hostname/IP validation. The findings do not demonstrate: - memory corruption, - code execution, - direct credential extraction, - bypass without a chain trusted by the FreeRDP client. ## Reproduction artifacts Local harness: - `E:\vul-tower\audit_freerdp_20260707\docker_repro\freerdp_tls_embedded_nul_san_handshake_harness.c` Latest upstream scripts/logs: - `run_tls_embedded_nul_san_handshake_repro.sh` / `tls_embedded_nul_san_handshake_asan_run.txt` - `run_tls_cn_fallback_with_san_handshake_repro.sh` / `tls_cn_fallback_with_san_handshake_asan_run.txt` - `run_tls_ip_dns_san_wrong_ip_san_handshake_repro.sh` / `tls_ip_dns_san_wrong_ip_san_handshake_asan_run.txt` - negative control: `tls_embedded_nul_san_attacker_control_asan_run.txt` Supported `3.28.0` was also reproduced with corresponding `*_3_28_0_repro.sh` scripts and logs. ## Suggested fix direction Prefer delegating identity validation to OpenSSL APIs: - use `X509_check_host()` for DNS hostname targets, - use `X509_check_ip_asc()` or equivalent IP-specific logic for IP-literal targets, - use ASN.1/OpenSSL-provided lengths instead of `strlen()` on SAN data, - reject DNSName entries containing embedded NUL bytes or invalid hostname bytes, - use Common Name fallback only when no DNS subjectAltName entries are present. ## Scope I am reporting these three cases together because they are all in FreeRDP's TLS certificate identity validation path and have the same fix direction: replace custom CN / DNS SAN string matching with OpenSSL's length-aware DNS and IP identity validation APIs. ### Reporter note Reported by Bin Luo, University of Electronic Science and Technology of China (UESTC).
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | FreeRDP (c/c++) | <= 3.28.0 | 3.29.0 | Patch available | GHSA-43hh-p3vw-hfx3 |
- FreeRDP (c/c++) Vendor— Affected <= 3.28.0 Fixed in 3.29.0 Patch available GHSA-43hh-p3vw-hfx3
Remediation
Update FreeRDP to version 3.29.0 or later, which fixes the flaw. The sources list no other fixed version for FreeRDP.
Written with Claude Haiku 5.5 from the sources below · 2026-11-12
- Fix · GHSA-43hh-p3vw-hfx3 FreeRDP (c/c++) Fixed in 3.29.0 Advisory →
Timeline
- 2026-11-12 Threatist record created from GHSA-43hh-p3vw-hfx3
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences