openai / openai/codex

Windows desktop login fails because OAuth callback ports are reserved by Windows

Open
#42,994 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app auth bug windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What version of the Codex App are you using (From “About Codex” dialog)?

26.901.41600

What subscription do you have?

At the moment Plus, but it was the same with Pro x5

What platform is your computer?

No response

What issue are you seeing?

I can't sign in with my ChatGPT account in the Windows desktop app. It fails with:

Sign-in failed: failed to start login server: Port 127.0.0.1:1457 is already in use

No process is listening on ports 1455 or 1457. However, both ports are inside Windows' excluded TCP range 1438–1537.

Native PowerShell CLI login also fails (not for the device code though). I have WSL 2 installed with mirrored networking enabled, but the desktop app is running on Windows.

What steps can reproduce the bug?
  1. Open the Windows desktop app.
  2. Select the option to sign in with ChatGPT.
  3. Login fails with the error above.
What is the expected behavior?

ChatGPT sign-in should work when Windows has reserved the callback ports. If those ports are unavailable, the desktop app should offer another way to sign in or explain how to resolve it.

Additional information

This PowerShell command returned no listeners:

Get-NetTCPConnection -State Listen -LocalPort 1455,1457 -ErrorAction SilentlyContinue |
    Select-Object LocalAddress,LocalPort,OwningProcess

This command showed an excluded range covering both ports:

netsh interface ipv4 show excludedportrange protocol=tcp

Relevant output:

Startport    Endport
1438         1537

I was able to sign in by stopping WinNAT in an Administrator PowerShell:

net stop winnat

I then completed ChatGPT sign-in in the Windows desktop app and restarted the service:

net start winnat

This worked around the login failure, but required manually stopping a Windows service.

Related reports:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows desktop OAuth callback failure with ports 1455 and 1457, using the reported PowerShell listener and excluded-port commands; compare the related reports #40344 and #39846. Trace the desktop login-server entry point and verify completion by signing in while the callback ports are reserved, without manually stopping WinNAT.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
authentication, desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.