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:
1 parent
58cf86d5eb
commit
44e2174fff
32 files changed
+431
-689
No files matched your search
@@ -452,8 +452,9 @@ func (s *Server) MaterializeSecret(ctx context.Context, req MaterializeSecretReq
|
||||
// DownloadRequest asks the host to download URL to Dest. The plugin must
|
||||
// declare a `net:` permission for the URL's origin (HTTPS, or HTTP for
|
||||
// loopback). Dest is relative to the plugin's data folder, or an absolute path
|
||||
// inside it or inside a VM root the plugin's driver declared. SHA256 (or
|
||||
// SHA256URL with SHA256Name selecting a line) makes the host verify the file.
|
||||
// inside it or inside a VM root the plugin's driver declared. The host verifies
|
||||
// every file, so SHA256 or SHA256URL (with SHA256Name selecting a line) is
|
||||
// required.
|
||||
type DownloadRequest struct {
|
||||
URL string `json:"url"`
|
||||
SHA256 string `json:"sha256,omitempty"`
|
||||
@@ -500,7 +501,6 @@ type ElevationResult struct {
|
||||
ExitCode int `json:"exit_code,omitempty"`
|
||||
RebootRequired bool `json:"reboot_required,omitempty"`
|
||||
LogoffRequired bool `json:"logoff_required,omitempty"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
// RequestElevation asks the host to run one whitelisted Windows elevation
|
||||
|
||||
Reference in new issue
Block a user