plugin: volume snapshot info: untaint snapshot filename
Without untainting, offline-deleting a volume-chain snapshot on a directory storage via the GUI fails with an "Insecure dependecy in exec [...]" error, because volume_snapshot_delete uses the filename its qemu-img invocation. Signed-off-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
committed by
Fabian Grünbichler
parent
43ec7bdfe6
commit
93f0dfbc75
@ -1789,6 +1789,7 @@ sub volume_snapshot_info {
|
|||||||
my $snapshots = $json_decode;
|
my $snapshots = $json_decode;
|
||||||
for my $snap (@$snapshots) {
|
for my $snap (@$snapshots) {
|
||||||
my $snapfile = $snap->{filename};
|
my $snapfile = $snap->{filename};
|
||||||
|
($snapfile) = $snapfile =~ m|^(/.*)|; # untaint
|
||||||
my $snapname = $get_snapname_from_path->($volname, $snapfile);
|
my $snapname = $get_snapname_from_path->($volname, $snapfile);
|
||||||
#not a proxmox snapshot
|
#not a proxmox snapshot
|
||||||
next if !$snapname;
|
next if !$snapname;
|
||||||
|
|||||||
Reference in New Issue
Block a user