Summary
FreeRDP may accept a server certificate even when its Subject Alternative Name (SAN) entries do not match the server identity, because validation can fall back to the Common Name or compare an IP address against a DNS name. A network-positioned attacker with a certificate issued by a CA trusted by the client could exploit this behavior to impersonate an RDP server and intercept a session.
Affected context
The issue occurs during server certificate checks in FreeRDP's tls_verify_certificate() function. Deployments may be at risk when clients connect to servers over networks an attacker can observe or influence, and the client trusts a CA capable of issuing a certificate for the attacker-controlled identity.
Exploit preconditions
- Attack surface: TLS certificate validation during an RDP connection
- Required access: The attacker must be able to position themselves between the FreeRDP client and the intended server or otherwise redirect the connection.
- Certificate condition: The attacker must present a certificate chaining to a CA trusted by the client.
- Trigger point: The client verifies the server certificate and identity as the RDP session is established.
- Why exploitation is possible: Permissive Common Name fallback and incorrect handling of IP identities can allow a certificate to pass identity checks despite a SAN mismatch.
Why this happens
The certificate verification logic does not enforce strict identity matching. It accepts a Common Name fallback when SAN entries do not match and can treat an IP literal as matching a DNS string. This is an improper certificate validation flaw (CWE-295): the peer's certificate chain may be trusted, but the certificate is not reliably bound to the specific server identity the client intended to contact.
Potential impact
- An attacker may impersonate an RDP server and intercept client connections.
- Session contents, including keystrokes, clipboard data, and screen content, could be exposed.
- An attacker could potentially alter relayed session traffic or use the impersonation to support further attacks.
General mitigation guidance
Defensive patterns focus on strict, standards-aligned server identity verification:
- Require identity matches against appropriate SAN entries and avoid Common Name fallback when SAN is present or required.
- Compare IP addresses only with IP-address SAN entries, and DNS names only with DNS-name SAN entries.
- Use secure-by-default TLS verification and avoid disabling certificate or hostname checks.
- Limit trusted certificate authorities to those needed for the environment, and protect certificate issuance and trust-store management.
- Where operationally appropriate, restrict client privileges and access to sensitive session data.
How teams detect issues like this
Review certificate-verification code and configuration for fallback behavior, mismatched identity-type comparisons, or paths that accept a trusted chain without verifying the intended server name. Static analysis and code review can look for permissive hostname matching and disabled verification checks. Policy enforcement can require strict SAN-based identity validation and controlled trust stores; connection and certificate logs may also help identify unexpected certificate identities.

