[Low] downloadImage has no timeout and no checksum verification
Report
Summary
downloadImage (vm/lima_manager.go:376-395, shared by both Lima and QEMU managers) uses http.Get with the default client (no timeout) and writes the bytes straight to the image path with no hash verification. It is called from NewLimaManager/NewQEMUManager when the cloud image is missing.
Root Cause
- No timeout:
http.Get(url)useshttp.DefaultClient(no timeout configured). A stalled or very slow image server hangs provider node startup indefinitely. - No integrity check: the downloaded bytes are written to the image path (
os.Rename(tempPath, destPath)) with no SHA-256 or other hash verification. HTTPS covers passive attackers; the gap is supply-chain (CDN compromise, DNS hijack with valid TLS).
Impact
(a) A stalled download hangs provider node startup indefinitely. (b) A compromised or misdirected download is used as the guest OS base image without any integrity check.
Verification
Source-level at HEAD 8cc209d (testnet-0006).
Suggested fix
Use an http.Client with a timeout, and pin + verify the SHA-256 of the Ubuntu cloud image before use.
Thread
Thanks. This is the same finding as an earlier report that is not public, which was filed first; the programme pays the first verifiable submission, so this one closes as a duplicate. If you believe it is a different bug, file a new report that links https://bounty.xe.network/XE-16760 and says what differs; it is read like any other.