Skip to content

[macOS][Browser] In-app browser tab stuck on ERR_UNSAFE_PORT error page: navigate-away and tab.close() are both rejected by URL policy #41386

Open

Description

@trukhinyuri

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

26.825.31414 (build 7287)

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.6.0 arm64 arm (macOS 26.6.2, build 25G83)

What issue are you seeing?

When an in-app browser tab is navigated to a Chromium-blocked port, Chromium correctly refuses the navigation with ERR_UNSAFE_PORT and renders its internal error page, which has a data: URL. That part is expected.

After that, the tab becomes unmanageable through the Browser API: the browser-side URL policy rejects both navigating the tab away to an ordinary https: page and tab.close(). The tab stays in browser.tabs.list() for the rest of the turn and can only be abandoned to end-of-turn cleanup. Creating a fresh tab works, so the browser connection itself is healthy.

The defect is not the unsafe-port rejection, it is that a tab whose current URL is an internal error page can no longer be navigated or closed.

What steps can reproduce the bug?

With the in-app browser (browser@openai-bundled, backend iab):

  1. const tab = await browser.tabs.new()
  2. await tab.goto("http://127.0.0.1:1/") — Chromium returns ERR_UNSAFE_PORT and renders its internal data: error page.
  3. await tab.goto("https://example.com/") — rejected by the browser URL policy instead of navigating.
  4. await tab.close() — also rejected, so the tab cannot be cleaned up.
  5. await browser.tabs.list() still lists the tab.

What is the expected behavior?

  • tab.close() should always be able to close an agent-created tab, regardless of the tab's current URL.
  • Navigating away from an internal error page to an allowed http:/https: target should be permitted.

In other words, the URL policy should gate the navigation target, not block recovery operations because of the URL the tab currently happens to be showing.

Additional information

In the shipped plugin (browser@openai-bundled 26.825.31414), scripts/browser-service.mjs contains an allow-list of about:blank, http: and https: and raises navigation_url_policy_blocked (“cannot visit the requested page because its URL is blocked by the … URL policy”) for anything else. Chromium's blocked-port error page is served from a data: URL, which fails that predicate, so it appears the policy check is applied to the tab's current URL rather than only to the requested target.

Activity

  1. added
    bug
    app
    on Aug 28, 2026
  2. aidawilliam41-ops commented on Sep 14, 2026

    @aidawilliam41-ops

    Additional Windows evidence for the internal error-page case, with a diagnostic-size problem.

    On September 14, 2026, two ordinary HTTPS navigation attempts ended on an internal network-error page showing ERR_NAME_NOT_RESOLVED. The CUA createBrowserTab calls returned:

    Blocked browser navigation by Browser Use URL policy: data:text/html;charset=utf-8,<internal network-error-page HTML omitted>
    

    The error embedded 20,904 characters of the internal error page's data URL. A subsequent cua.listTabs() also repeated that large URL in the tab inventory. A later combined call to retrieve the existing tab and navigate it to another HTTPS page also failed on the current data URL; the failing sub-operation was not isolated.

    The recorded events were at 16:28:04 UTC and 18:34:02 UTC. This extends the original macOS/ERR_UNSAFE_PORT example to Windows/DNS failure and shows how the internal error page also expands routine tool output. The original DNS failure is not attributed to Codex. Closing the tab was not tested in these episodes. The exact app build at the time was not recorded; the installed package during report preparation is OpenAI.Codex 26.908.4834.0.

    Please summarize internal network-error pages with the underlying error code and a short diagnostic, and bound their URL representation in tab inventory output. Raw error-page HTML and private browsing/account data have been omitted here.

  3. DotNaos commented on Oct 16, 2026

    @DotNaos

    Confirmed the settled internal network-error-page recovery failure on macOS with Codex desktop 26.1013.31256 (build 20586), macOS 27.2, arm64.

    Using a disposable in-app Browser tab and a local address that refused connections (no server or app changes):

    1. Navigation returned ERR_CONNECTION_REFUSED.
    2. After the app-generated error page settled, obtaining/inspecting the tab, reload(), navigation away to https://example.com, and close() each failed with:
      Blocked browser navigation by Browser Use URL policy: data:text/html;charset=utf-8,<internal error document omitted>.
    3. A fresh tab opened https://example.com successfully.
    4. An immediate retry before the error document settled could succeed. This timing difference may explain inconsistent reproductions.

    Read-only inspection of the installed bundle supports the recovery-boundary diagnosis: the error-page builder retains the original failed URL separately but loads an internal data: page; the Browser command handler checks the current webContents URL before checking the new navigation target; the scheme predicate permits HTTP/HTTPS and about:blank. The current official Browser/settings docs expose website permissions and developer access, but no supported switch for disabling this scheme predicate was found.

    Suggested bounded fix: recognize only app-generated error pages using the existing per-tab error-page record; allow authorized lifecycle closure and navigation/reload recovery, while revalidating the requested destination or recorded original failed URL through existing URL, origin, network and approval checks. Preserve restrictions on arbitrary data: document inspection/evaluation. Also shorten diagnostics so they do not include the full encoded error document.

    Regression cases should include settled versus immediate recovery, refused connection/DNS failures, reload/navigate-away/close, stale or forged error-page records, prohibited destinations and redirects, and cross-tab/session isolation.

    This confirms recovery failure after a normal connection error; it does not attribute the initial network outage or a renderer crash to the URL policy. No bundled files, settings or safeguards were modified. Private URLs, host/user names, task/session IDs, credentials and raw error HTML are omitted.

  4. lisn0 commented on Oct 31, 2026

    @lisn0

    Additional macOS evidence on Codex desktop 26.1027.30824 (build 22943), the installed version checked on 2026-10-31. During a local development preview workflow, navigation in an existing in-app Browser tab returned ERR_CONNECTION_REFUSED and left the app-generated data:text/html network-error page. After the HTTP preview was available, a subsequent tab.goto() in that same tab to the allowed preview URL was rejected with Blocked browser navigation by Browser Use URL policy: data:text/html.... A fresh tab in the same in-app Browser then reached that same HTTP preview successfully. No error-page content was accessed and no policy or browser state was changed to bypass the rejection. This adds a same-browser control showing that the target preview was reachable while the error-page tab could not navigate to it; it does not establish the implementation cause. The Browser guide documents localhost page preview as a supported workflow: https://learn.chatgpt.com/docs/browser.

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

    appbrowserbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions