Skip to content

[Bug] Cloudflare WAF misidentifies official desktop daemon (codex.exe) as a bot, returning 403 and locking Personal Plus accounts behind "Contact your admin" #47197

Open

Description

@tomastro

Summary

OpenAI's official desktop client (ChatGPT Beta / OpenAI.CodexBeta) is being systematically blocked by OpenAI's own Cloudflare WAF.

While browser sessions (chatgpt.com) pass Turnstile challenges automatically, the desktop application's internal background daemon (codex.exe) is a native Rust HTTP client that cannot evaluate browser JavaScript. Cloudflare's bot management classifies direct API calls from this daemon as an automated scraping tool and blocks them with HTTP 403 Forbidden (Managed Challenge).

As a result:

  1. The daemon fails to fetch the user's subscription metadata from auth.openai.com/api/accounts.
  2. The internal account/read RPC falls back to planType: "unknown".
  3. The Electron frontend UI misinterprets the account as belonging to an unauthorized enterprise workspace, completely hides all existing local chat history, and renders the generic modal: "🔒 You don't have access to Codex yet. Contact your admin to request access."

This affects personal ChatGPT Plus subscribers who have no workspace administrators.

Environment

  • OS: Windows 11 Core (Build 10.0.26220 x64)
  • App Version: ChatGPT (Beta) / OpenAI.CodexBeta_26.727.4816.0_x64__2p2nqsd0c76g0
  • Core Binary: codex.exe (0.146.0-alpha.9.2)
  • Subscription: Personal ChatGPT Plus (role: owner, is_default: true, Personal Organization: org-<redacted>)
  • Web Browser Access: Normal (chat history, Plus features, and models work as expected on Chrome/Brave)

Technical Root Cause (Verified with Raw Telemetry)

1. Local Chat History is Intact in SQLite

Querying the internal app-server daemon directly via JSON-RPC (thread/list) confirms that all local threads and session data in ~/.codex/state_5.sqlite and thread_history_1.sqlite remain intact:

{
  "data": [
    {
      "id": "01a0bf83-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
      "preview": "<user thread preview text>",
      "title": "<thread title>"
    }
  ]
}

The data is not lost. The frontend UI intentionally hides the sidebar because the user's account state cannot be verified.

2. Frontend Guards Block UI Due to planType: "unknown"

Tracing the internal app-server communication (account/read RPC called by the Electron UI on launch) returns:

{
  "id": 3,
  "result": {
    "account": {
      "type": "chatgpt",
      "email": "<[email protected]>",
      "planType": "unknown"
    },
    "requiresOpenaiAuth": true
  }
}

Because planType resolves to "unknown", the UI executes its authorization guard: it suppresses the "Personal" workspace, disables chat history projection, and displays the fallback enterprise error modal.

3. Root Failure: Cloudflare Managed Challenge (403) Intercepts Backend Daemon

Decompilation and runtime inspection of codex.exe reveals that the daemon queries personal subscription metadata via:

  • https://auth.openai.com/api/accounts
  • https://chatgpt.com/backend-api/me

When codex.exe issues HTTP requests with a valid bearer token, Cloudflare WAF intercepts the traffic and responds with HTTP 403 Forbidden containing a Turnstile Managed Challenge HTML payload:

HTTP/1.1 403 Forbidden
CF-Ray: <redacted>-KIX (Cloudflare Edge)
Content-Type: text/html; charset=UTF-8

<!DOCTYPE html>
<html>
  <head><title>Just a moment...</title></head>
  <body>
    <span id="challenge-error-text">Enable JavaScript and cookies to continue</span>
    <script>window._cf_chl_opt = { cType: "managed", ... };</script>
  </body>
</html>

Because codex.exe lacks a JavaScript runtime, it cannot satisfy the Turnstile challenge. Consequently:

  • auth.tokens.account_id is left empty ("").
  • logs_2.sqlite loops continuously:
    waiting to resolve remote control preference until authentication is available error=remote control enrollment is waiting for a ChatGPT account id
  • account/read returns planType: "unknown".

Steps to Reproduce

  1. Install the ChatGPT Desktop App (OpenAI.CodexBeta or official Windows package).
  2. Log in using a Personal ChatGPT Plus account.
  3. Observe that all chat history is absent from the sidebar.
  4. Attempt to access Codex; observe the modal: "You don't have access to Codex yet. Contact your admin to request access."
  5. Inspect ~/.codex/logs_2.sqlite and note the loop waiting for account_id and 403 responses from /backend-api/ and /api/accounts.

Suggested Fix

  1. WAF Whitelisting: Configure Cloudflare WAF rules for auth.openai.com/api/accounts and /backend-api/ to allow validly authenticated Codex daemon requests (e.g. via signed headers or dedicated user-agent handling) without forcing Turnstile challenges.
  2. JWT Claims Injection: Include chatgpt_plan_type and chatgpt_account_id directly in the OAuth ID/Access Token claims at /oauth/token to remove the daemon's dependency on secondary un-browsed API queries.

Activity

  1. added
    bug
    app
    windows-os
    auth
    connectivity
    on Sep 22, 2026
  2. lawnjarre-star commented on Sep 28, 2026

    @lawnjarre-star

    I can reproduce the same issue on the current Windows desktop release.

    Environment

    • OS: Windows 11 Home, 64-bit, version 10.0.26200 (build 26200)
    • App package: OpenAI.Codex
    • App version: 26.924.2738.0
    • Package status: OK
    • Account: Personal ChatGPT Plus
    • Connection: direct Ethernet connection
    • WinHTTP proxy: direct access
    • Windows user proxy: disabled
    • Active VPN/TUN adapter: none detected

    Actual behavior

    After updating the Windows desktop app, the sidebar cannot synchronize any ChatGPT history, projects, pinned chats, subscriptions, or settings. Existing cloud conversations appear missing in the desktop client.

    The same account works normally at https://chatgpt.com/ in Chrome on the same computer and network. Projects, pinned chats, recent chats, and existing conversations all load correctly in the browser, confirming that the account data has not been deleted.

    Diagnostic evidence

    The desktop app log repeatedly records sa_server_request_failed with HTTP 403 for routes including:

    • /conversations/batch
    • /conversations/{conversation_id}
    • /conversation/init
    • /gizmos/snorlax/sidebar
    • /gizmos/{gizmo_id}/conversations
    • /settings/user
    • /subscriptions
    • /pins
    • /automations
    • /sentinel/heartbeat

    The response body is a Cloudflare Managed Challenge HTML page containing Enable JavaScript and cookies to continue. The app cannot execute this challenge for its backend requests, so virtually all history-related API calls fail with 403.

    Reproduction

    1. Install or update to Windows desktop app version 26.924.2738.0.
    2. Sign in with a Personal ChatGPT Plus account.
    3. Open the desktop app sidebar.
    4. Observe that history, projects, pinned chats, and other account-backed information do not synchronize.
    5. Open the same account in Chrome on the same computer and network.
    6. Observe that all history and projects load normally.

    Expected behavior

    Authenticated requests made by the official Windows desktop client should not be subjected to a JavaScript-only Cloudflare challenge. The desktop client should load the same account history and projects available on the web client.

    Impact and workaround

    The desktop client is effectively unusable for existing ChatGPT history. The current workaround is to use chatgpt.com in a standalone Chrome app window.

    This appears consistent with this issue. Please allow authenticated official-client requests through the relevant WAF rule or use an authentication path that does not require a browser-executed challenge.

    No full logs are attached because they contain account and conversation identifiers. I can provide a sanitized excerpt if maintainers request it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appauthbugconnectivitywindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions