Skip to content

[Bug]: Web server binds to 0.0.0.0 exposing read/write PTY sessions to network #19

@ja-mf

Description

@ja-mf

The embedded HTTP/WebSocket server in src/web/server/server.ts calls Bun.serve() without specifying a hostname, defaulting to 0.0.0.0.

This exposes the API to all network interfaces, allowing for remote code execution by just nmap discovery, an attacker who can reach the host can:

  • List and read PTY session output (GET /api/sessions, GET /api/sessions/:id/buffer/*)
  • Send arbitrary input to running PTY sessions (POST /api/sessions/:id/input)
  • Kill sessions (DELETE /api/sessions/:id)
  • Spawn new processes via the API (POST /api/sessions)

Fix: Bind to 127.0.0.1 by default with configurable hostname support, can suggest a PR if needed, but this is a critical security issue that should be addressed ASAP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions