fix: harden guest driver host APIs

- run elevated actions as fixed System32 tools instead of a hidden subcommand
- require a SHA-256 for plugin downloads
- keep records of secret files that could not be deleted, and never overwrite
  files the host did not create
- stop two concurrent requests from starting the same VM
- drop invalid endpoints instead of failing the whole VM list, and reject ssh
  users and IPv6 zones that could inject command-line text
- accept driver screenshots only at the requested path
- do not treat an unreadable guest phase as normal

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
NwflowerandClaude Opus 5.5 committed 2026-12-03 09:07:46 -07:00
1 parent 58cf86d5eb
commit 44e2174fff
32 files changed
+431 -689

No files matched your search

+4 -1
View File
@@ -15,6 +15,9 @@ import (
const maxRPCFrameBytes = 8 << 20 // 8 MiB per JSON-RPC frame (large blobs go via file paths, §8)
// RPCMethodNotFound is the code a peer answers for a method it does not serve.
const RPCMethodNotFound = -32601
// RPCError is a JSON-RPC 2.0 error object.
type RPCError struct {
Code int `json:"code"`
@@ -246,7 +249,7 @@ func (c *RPCConn) dispatchInbound(env rpcEnvelope) {
if h == nil {
if len(env.ID) > 0 {
c.sendResponse(env.ID, nil, &RPCError{Code: -32601, Message: "method not found: " + env.Method})
c.sendResponse(env.ID, nil, &RPCError{Code: RPCMethodNotFound, Message: "method not found: " + env.Method})
}
return
}