The NSCodec vulnerability in FreeRDP reveals a validation ordering failure that is more insidious than a simple bug: the codec is disabled, but the disabled state doesn't protect the client because the null dereference occurs before the disabled check takes effect. This means the defensive check was placed downstream from where untrusted remote input first enters the vulnerable code path — during Surface Bits command processing, specifically during codec identification, not during actual decode.
The critical detail is that NSCodec being 'disabled' yet still triggerable suggests someone added a defensive measure without tracing the full execution flow of malicious server input. The disabled check was likely written in response to a specific crash during decode, but the null dereference happens earlier — during the phase where the client attempts to resolve which codec a given Surface Bits command uses. That's a different execution phase, which means the developer who added the check was patching one crash vector while another remained open. The protection layer was implemented against the symptom (decode crash) rather than the entry point (codec identification).
This is not an isolated issue. The pattern of untrusted input entering a codec path marked 'disabled' at a point after the null pointer is already dereferenced has appeared across multiple RDP implementations in CVE-2012-4536, CVE-2014-0252, and CVE-2015-0798. The institutional failure is consistent: developers treat 'disabled' as a runtime state to check during execution rather than as an input validation assertion that must fire at the trust boundary. NSCodec's implementation survived disabling intact — present in the binary, with code paths still executable by server input — but in a liminal state: not active enough to maintain, but not removed enough to be safe.
What makes this exploitable is the server-to-client trust boundary. A compromised or malicious server can trigger the null dereference against any connected client with zero user interaction and no authentication bypass required. The CVSS 6.5 rating doesn't capture the severity in environments where untrusted RDP servers are plausible — a simple network position plus one crafted Surface Bits command equals a client crash.
The practical implications: audit other disabled or optional codecs in FreeRDP's codec negotiation pipeline for similar gaps, not just NSCodec. The 'disabled' state was treated as 'won't be reached' rather than 'must not be reachable' — and that distinction is where the vulnerability lives.