### Security Patch Addresses DNS Leak Vulnerability in Codex CLI
A recent security update for the OpenAI Codex command-line interface has corrected a significant privacy flaw involving how the tool handles network requests. Prior to this patch, the proxy mechanism would initiate a DNS resolution process for a hostname before verifying if that specific host was permitted. Consequently, even if the proxy eventually blocked the connection, the request had already been broadcast to the DNS provider, potentially exposing internal or sensitive hostnames to third-party infrastructure.
#### Strengthening the Permission Workflow
The release of Codex CLI version 0.163.0, which arrived on October 15, introduces a more rigorous security posture. According to the OpenAI’s changelog, the software now mandates a permission check prior to any DNS lookup. Furthermore, the update includes safeguards against duplicate Host headers and closes loopholes that previously allowed credential aliases to circumvent established inspection hooks.
#### Technical Implications of the Fix
The underlying issue was more severe than a simple logic error. Documentation from the merged pull request clarifies that the previous behavior resulted in an unintentional information disclosure. By resolving unapproved hostnames, the system leaked metadata to DNS servers regardless of the final connection status.
Additionally, the vulnerability was compounded by the way the tool interacted with macOS environments. The pull request noted that allowing local binding within a managed macOS sandbox effectively provided a bypass, granting direct outbound access to port 53-the standard port for DNS traffic. This could have allowed traffic to bypass intended network restrictions entirely.
#### Why This Matters
In modern cybersecurity, DNS leaks are a common but often overlooked vector for data exfiltration. When a system resolves a domain name, that query is typically logged by the recursive resolver. If an application resolves a private or internal hostname before checking its own security policy, it inadvertently signals the existence of that resource to external entities. By reordering the validation logic to prioritize permission checks, OpenAI has effectively closed a gap that could have been exploited to map internal network structures or track user activity.
The Codex CLI 0.163.0 update was officially released on October 15. Image: OpenAI
