mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-18 23:12:59 +02:00
backup: Sanitise content of ADDON variable
References: #11830 Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
@@ -124,6 +124,12 @@ if ( $cgiparams{'ACTION'} eq "backup" )
|
||||
}
|
||||
if ( $cgiparams{'ACTION'} eq "addonbackup" )
|
||||
{
|
||||
# Exit if there is any dots or slashes in the addon name
|
||||
exit(1) if ($cgiparams{'ADDON'} =~ /(\.|\/)/);
|
||||
|
||||
# Check if the addon exists
|
||||
exit(1) unless (-e "/var/ipfire/backup/addons/includes/$cgiparams{'ADDON'}");
|
||||
|
||||
system("/usr/local/bin/backupctrl addonbackup $cgiparams{'ADDON'} >/dev/null 2>&1");
|
||||
}
|
||||
elsif ( $cgiparams{'ACTION'} eq "delete" )
|
||||
|
||||
Reference in New Issue
Block a user