Skip to content

browse proxy: daemon crashes when an env proxy carries credentials beside BROWSE_PROXY_USER/PASS (#3448 widens it) #3457

Closed

Description

@capy-ai

Found during the #3448 review (GStack Minder decision, 2026-10-26). Pre-existing on main; #3448 widens the set of inputs that reach it.

The daemon crashes when an env proxy carries credentials and BROWSE_PROXY_USER/PASS are also set

With BROWSE_PROXY_USER/BROWSE_PROXY_PASS set and a standard proxy variable, the CLI's resolveProxy embeds the env credentials into the BROWSE_PROXY_URL it hands the daemon, and startServer spawns the daemon with { ...process.env }, so BROWSE_PROXY_USER/PASS also reach the daemon. The daemon's parseProxyConfig then sees credentials in both the URL and the env and throws proxy creds set in both env (BROWSE_PROXY_USER) and URL — pick one source, and the CLI reports only "Server failed to start within 15s".

Reproduced through the real CLI: HTTPS_PROXY=http://127.0.0.1:1 BROWSE_PROXY_USER=a BROWSE_PROXY_PASS=b browse ... → the start line prints http://***:***@127.0.0.1:1/, the daemon log has the "pick one source" line, and the CLI ends with the misleading timeout.

Identical code on main for http://proxy:3128 values and for --proxy. #3448 makes it reachable from one more spelling: a scheme-less HTTPS_PROXY=host:3128 plus BROWSE_PROXY_USER/PASS used to warn and go direct, and now hits this path too.

Evidence: browse/src/server.ts ~1895 — envUser: process.env.BROWSE_PROXY_USER, envPass: process.env.BROWSE_PROXY_PASS, source: proxySource,; the embedding is in resolveProxy (url.username = ...).

Proposed fix: strip BROWSE_PROXY_USER/BROWSE_PROXY_PASS from the daemon env in startServer (or in proxyServerEnv) when the resolved BROWSE_PROXY_URL already carries userinfo, so the daemon sees one credential source. Add a proxy-env-daemon case that starts a daemon with env credentials.

Open question (from #3448)

The path/query/fragment refusal added in #3448 also sends credential-free env values with a path direct: HTTPS_PROXY=http://proxy.corp:3128/pac parsed on main (path dropped, session proxied) and now warns and goes direct. The refusal exists to keep a password out of the URL path, which cannot happen without a userinfo. Should the refusal be narrowed to values that carry an @ (userinfo present), so a credential-free .../pac stays proxied as before? #3448 documents the current behavior in the CHANGELOG as a stated narrowing.

Activity

  1. added
    S3
    on Oct 31, 2026
  2. capy-ai commented on Oct 31, 2026

    @capy-ai
    ContributorAuthor

    Fix for the daemon crash is in #3739. It's broader than this issue's title: with BROWSE_PROXY_USER/BROWSE_PROXY_PASS set, the daemon refused to start for every proxy spelling (--proxy, BROWSE_PROXY_URL and the standard proxy variables), not only for credentialed env URLs.

    The open question above, whether to stop refusing a path in a credential-free proxy URL (so HTTPS_PROXY=http://proxy.corp:3128/pac is proxied again instead of warning and going direct), is not in #3739. It changes behavior, so it stays here as a follow-up for a separate decision.

  3. capy-ai commented on Nov 3, 2026

    @capy-ai
    ContributorAuthor

    Fixed in #3739, merged to main as 8319372 (v1.93.30.0). When browse passes a resolved BROWSE_PROXY_URL to the daemon, it now blanks BROWSE_PROXY_USER/PASS, so the daemon stops refusing its own merged credentials and starts normally. The question about narrowing the path refusal for credential-free URLs is still open as a follow-up (see the earlier comment).

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

    S3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions