{"id":"XE-9838","kind":"bounty","visibility":"public","source":"web","source_repo":"","source_ref":"","source_url":"","reporter_id":730,"title":"Unauthenticated Information Disclosure: GET /vms and GET /vms/{lease} expose private consumer credentials and VM metadata to unauthenticated callers","area":"node-api","claimed_tier":null,"assessed_tier":null,"verdict":"duplicate","duplicate_of":"XE-0015","tracked":true,"internal_ref":"#1083","internal_url":"https://github.com/xeprotocol/core/issues/1083","status":"closed","closed_reason":"duplicate","github_state":"","disclosed_at":null,"award_xe":null,"award_approved":false,"paid_ref":"","created_at":"2026-11-12T07:38:46.484811+00:00","updated_at":"2026-11-20T00:33:18.361937+00:00","source_created_at":null,"told_at":"2026-11-20T00:33:18.381424+00:00","status_changed_at":"2026-11-20T00:33:18.368772+00:00","url":"https://bounty.xe.network/XE-9838","body":"## Vulnerability Summary\n\nIn `api/handler.go:200-201`, the HTTP API exposes routes to inspect running virtual machine instances:\n```go\n\t\t{\"GET\", \"/vms\", \"All running VMs\", h.handleGetVMs},\n\t\t{\"GET\", \"/vms/{lease}\", \"VM info for a lease\", h.handleGetVM},\n```\n\nNotice that while administrative routes (like `/lease/request` or `/lease/{hash}/renew`) require `h.requireAdmin(...)`, and chat message inspection requires ownership proof (`requireChatOwnership`), `/vms` and `/vms/{lease}` are **completely unauthenticated and unprotected**!\n\nIn `api/vm.go:98-115`:\n```go\nfunc (h *Handler) handleGetVMs(w http.ResponseWriter, r *http.Request) {\n\twriteJSON(w, http.StatusOK, h.node.GetVMs())\n}\n\nfunc (h *Handler) handleGetVM(w http.ResponseWriter, r *http.Request) {\n\tleaseHash := r.PathValue(\"lease\")\n\tif leaseHash == \"\" {\n\t\twriteError(w, http.StatusBadRequest, \"missing lease hash\")\n\t\treturn\n\t}\n\tinfo := h.node.GetVM(leaseHash)\n\tif info == nil {\n\t\twriteError(w, http.StatusNotFound, \"vm not found\")\n\t\treturn\n\t}\n\twriteJSON(w, http.StatusOK, info)\n}\n```\n\nIn `vm/qemu_manager.go:264-269` and `node/vm.go:120-165`, `vm.Info` contains sensitive execution metadata:\n```go\ntype Info struct {\n\tLeaseHash    string       `json:\"lease_hash\"`\n\tStatus       string       `json:\"status\"`\n\tResources    *Resources   `json:\"resources,omitempty\"`\n\tCredentials  *Credentials `json:\"credentials,omitempty\"`\n\tCreatedAt    int64        `json:\"created_at\"`\n\tSSHPort      int          `json:\"ssh_port,omitempty\"`\n\tTunnelTarget string       `json:\"tunnel_target,omitempty\"`\n}\n```\n\nWhen consumer nodes track active leases in `n.consumerVMs` (`node/vm.go`), the `vm.Info` struct stores the instance's access credentials, SSH ports, lease hashes, and tunnel target endpoints.\n\n---\n\n## Vulnerable Code Locations\n\n- `api/handler.go:200-201`:\n  `/vms` and `/vms/{lease}` are registered without `h.requireAdmin` or consumer signature verification.\n- `api/vm.go:98-115`:\n  `handleGetVMs` and `handleGetVM` serialize `vm.Info` directly to any unauthenticated HTTP requester.\n\n---\n\n## Attack & Failure Scenario\n\n1. Any unauthenticated network client (or external attacker scanning port 8080/API across the network) sends:\n   `GET http://<node-ip>:8080/vms`\n2. The node dumps the entire list of currently active virtual machines, including:\n   - `LeaseHash` (allowing targeted front-running of lease transactions).\n   - `Credentials` (generated SSH passwords or keys if stored).\n   - `SSHPort` and `TunnelTarget` (revealing internal network topology and host port bindings).\n3. The attacker can then connect to `/tunnel/{leaseHash}/tcp` or attack guest ports directly, compromising guest VM privacy and provider infrastructure.\n\n---\n\n## Impact\n\n1. **Confidentiality Breach / Credential Exposure**:\n   Unauthenticated third parties can harvest active VM lease identifiers, resource allocations, and access configurations across both provider and consumer nodes.\n2. **Reconnaissance for VM Hijacking**:\n   Attackers gain actionable targeting data to direct tunnel hijacking or brute-force attacks against active VM instances.\n\n---\n\n## Remediation\n\nRequire admin authorization (or ownership signature proof from the lease consumer/provider) on `/vms` and `/vms/{lease}` in `api/handler.go`:\n```go\n\t\t{\"GET\", \"/vms\", \"All running VMs (operator only: requires admin bearer token)\", h.requireAdmin(h.handleGetVMs)},\n\t\t{\"GET\", \"/vms/{lease}\", \"VM info for a lease (operator only: requires admin bearer token)\", h.requireAdmin(h.handleGetVM)},\n```","patch_refs":[],"thread":[{"id":13210,"source":"desk","source_ref":"reply:11232","author":"Joseph Denne","team":true,"body":"Thanks. This is the same finding as https://bounty.xe.network/XE-0015, which was filed first; the programme pays the\nfirst verifiable submission, so this one closes as a duplicate. If you believe it is a different\nbug, file a new report that links https://bounty.xe.network/XE-9838 and says what differs; it is read like any other.","created_at":"2026-11-20T00:33:18.361937+00:00"}]}