GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — antigravity-ls-proxy: ANTIGRAVITY_LS_ADDRESS port parsed with bare parseInt — malformed addresses silently discarded, managed daemon spawned instead · Issue #494 · developing-today/code

antigravity-ls-proxy: ANTIGRAVITY_LS_ADDRESS port parsed with bare parseInt — malformed addresses silently discarded, managed daemon spawned instead #494

New issue
Copy link
New issue
Copy link
Closed
#495
Closed
antigravity-ls-proxy: ANTIGRAVITY_LS_ADDRESS port parsed with bare parseInt — malformed addresses silently discarded, managed daemon spawned instead#494
#495
Copy link
Assignees
dezren39

Description

@dezren39
dezren39
opened on Oct 21, 2026
Issue body actions

Problem

bin/antigravity-ls-proxy.mjs validates its own listen port strictly via the shared parseProxyPort helper (#483), but the port it connects to — taken from the operator-supplied ANTIGRAVITY_LS_ADDRESS env var — is parsed with a bare parseInt and no validation at all.

bin/antigravity-ls-proxy.mjs:199-202 (LanguageServerManager.detectRunningInstances):

if (process.env.ANTIGRAVITY_LS_ADDRESS && process.env.ANTIGRAVITY_CSRF_TOKEN) {
  const parts = process.env.ANTIGRAVITY_LS_ADDRESS.split(':');
  const port = parseInt(parts[parts.length - 1], 10);
  return [{ port, token: process.env.ANTIGRAVITY_CSRF_TOKEN }];
}

This branch returns immediately, bypassing even the weak check in the add() helper below it (p > 0, lines 207-214 — which itself has no <= 65535 upper bound, so candidate ports discovered from ps/ss/lsof/log lines are also unbounded above).

Evidence (verified this run on main 72a52d4)

Replaying the exact lines 200-202 logic in Node:

ANTIGRAVITY_LS_ADDRESS resulting candidate port
127.0.0.1:abc NaN
127.0.0.1: NaN
127.0.0.1:99999 99999
127.0.0.1:0 0
127.0.0.1:-5 -5
127.0.0.1:18745abc 18745 (trailing junk silently dropped)
127.0.0.1:18745.9 18745 (fraction silently dropped)

And the add() helper accepts 99999 / 65536 as candidate ports.

Why it matters

  • ensureActive() (line 271+) heartbeats each candidate via checkHeartbeat(port, token), which fetches http://127.0.0.1:${port}/.... With NaN, 0, -5 or 99999 that fetch simply fails and is swallowed (catch { return false }), so a typo'd explicit address is silently discarded and the proxy falls through to startManagedDaemon() — spawning a second, managed language server instead of telling the operator their configured address is malformed. That masks configuration errors and can attach the session to the wrong (fresh) server.
  • 18745abc / 18745.9 silently connect to port 18745, the same wrong-port class bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483 fixed for the *_PROXY_PORT listen ports.
  • The bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483 guard test (bin/proxy-port.test.mjs, "all seven parse sites…") only regexes parseInt(process.env.[A-Z_]*PROXY_PORT, so this site — an *_ADDRESS, not a *_PROXY_PORT — slips past the guard that was meant to prevent regressions of this class.

Suggested fix / acceptance criteria

  • The ANTIGRAVITY_LS_ADDRESS port is validated strictly (digits only, integer 1-65535), reusing parseProxyPortValue from bin/proxy-port.mjs where practical; a malformed address fails fast with an error naming ANTIGRAVITY_LS_ADDRESS and the offending value, instead of silently falling back to a managed daemon.
  • The add() candidate helper rejects ports > 65535 as well as <= 0 / NaN.
  • Regression tests cover at least: abc, empty port, 0, 99999, 18745abc, 18745.9, and a valid host:18745; and the bin proxies: *_PROXY_PORT parsed with bare parseInt — invalid values crash opaquely or bind the wrong port #483 guard test (or a new one) catches a bare parseInt on the ANTIGRAVITY_LS_ADDRESS path.
  • node --test bin/proxy-port.test.mjs (plus any new test file) passes.

Dedup: #483 covered only the *_PROXY_PORT listen ports (closed); #435 is about single-sourcing the proxies' port configuration in opencode config, not about validating this address; no open or closed issue covers ANTIGRAVITY_LS_ADDRESS parsing.

Activity

  1. github-actions
    assigned
    dezren39
    on Oct 21, 2026
  2. dezren39
    added a commit that references this issue on Oct 21, 2026

    Merge pull request #495 from developing-today/creator/494-antigravity…

    d7a6d90
  3. dezren39
    closed this as completedin #495on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.