mirror of
https://github.com/unraid/webgui.git
synced 2026-01-06 01:29:54 -06:00
fix: web-components-extractor escape shell arguments in find command
- Updated the find command in WebComponentsExtractor to use escapeshellarg for both base path and manifest name to prevent command injection vulnerabilities.
This commit is contained in:
@@ -13,7 +13,9 @@ class WebComponentsExtractor
|
||||
private function findManifestFiles(string $manifestName): array
|
||||
{
|
||||
$basePath = '/usr/local/emhttp' . self::PREFIXED_PATH;
|
||||
$command = "find {$basePath} -name {$manifestName}";
|
||||
$escapedBasePath = escapeshellarg($basePath);
|
||||
$escapedManifestName = escapeshellarg($manifestName);
|
||||
$command = "find {$escapedBasePath} -name {$escapedManifestName}";
|
||||
exec($command, $files);
|
||||
return $files;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user