mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-19 02:37:24 +08:00
The nbd export endpoints interpolated the request disk_id into shell commands (sh -c with the joined qemu-nbd command line, and ps|grep for the process check), so a crafted disk_id could execute arbitrary commands as root on the host image service. - Require the disk_id to be a plain UUID in both export and close endpoints - Run qemu-nbd with argv instead of sh -c - Check the export process via its pid file and kill -0 instead of shell pipelines - Add unit tests for the validation and the process check Co-authored-by: Qiu Jian <qiujian@yunionyun.com> Co-authored-by: Claude <noreply@anthropic.com>