Skip to content

Local Auth Server Exposed to Network #10

Open

Description

@percpyc

Local Auth Server Exposed to Network

Affected commit

Repository: https://github.com/zidsa/vitrin-cli

Git commit: 45e59e4983cec15e11845582d337ff122f62c61c

Description

The Express server for the authentication callback uses app.listen(port) without explicitly specifying a hostname. In Node.js, this defaults to binding the server to all network interfaces (0.0.0.0 or ::) rather than restricting it to the local loopback interface (127.0.0.1). Because the server listens on an unrestricted IP address and handles the unauthenticated /auth/callback endpoint, any actor on the same local network can send HTTP requests to the developer's machine on port 4444 during the 10-minute timeout window. Without host restriction, a network attacker can proactively push an arbitrary authentication token into the developer's CLI session, bypassing the intended local-only flow and hijacking the developer's credentials.

Steps to Reproduce

  1. The developer initiates the CLI login command, starting the local listener on port 4444 across all network interfaces.
  2. The attacker scans the local subnet for port 4444 to detect the active authentication listener.
  3. The attacker sends a direct HTTP request to http://<developer-ip>:4444/auth/callback?token=<attacker-controlled-token>.
  4. The server accepts the token, completes the authentication process, and shuts down.
  5. Subsequent CLI operations performed by the developer operate under the attacker's account.

Expected impact

  • Unauthorized users on the local network can inject arbitrary authentication tokens.
  • The developer's CLI environment is hijacked, leading to operations executing under the attacker's context.

Demonstrated Impact

The authentication callback server accepted a request through a non-loopback IPv4 address because listen(port) did not restrict the bind host.

Scope and Limitations

The test requires a non-loopback interface. Reachability from another host also depends on host firewall and network policy.

Private vulnerability report

https://github.com/zidsa/vitrin-cli/security/advisories/GHSA-xrgp-47jr-7797

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions