Repository navigation
Description
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
- The developer initiates the CLI login command, starting the local listener on port 4444 across all network interfaces.
- The attacker scans the local subnet for port 4444 to detect the active authentication listener.
- The attacker sends a direct HTTP request to http://<developer-ip>:4444/auth/callback?token=<attacker-controlled-token>.
- The server accepts the token, completes the authentication process, and shuts down.
- 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.
Activity