mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Archive extraction] Remove leading slashes to prevent absolute path attack.
This commit is contained in:
@@ -258,6 +258,9 @@ sealed class ArchiveExtractCommand : Command
|
||||
Replace('/', '\\');
|
||||
}
|
||||
|
||||
// Prevent absolute path attack
|
||||
fileName = fileName.TrimStart('\\').TrimStart('/');
|
||||
|
||||
string outputPath = Path.Combine(outputDir, fileName);
|
||||
string destinationDir = Path.GetDirectoryName(outputPath);
|
||||
if(destinationDir is not null)
|
||||
|
||||
Reference in New Issue
Block a user