Merge pull request from GHSA-6324-52pr-h4p5
Co-authored-by: Zeegaan <nge@umbraco.dk>
This commit is contained in:
@@ -311,7 +311,12 @@ public class CreatedPackageSchemaRepository : ICreatedPackagesRepository
|
||||
definition.Name.Replace(' ', '_')));
|
||||
Directory.CreateDirectory(directoryName);
|
||||
|
||||
var expectedRoot = _hostingEnvironment.MapPathContentRoot(_createdPackagesFolderPath);
|
||||
var finalPackagePath = Path.Combine(directoryName, fileName);
|
||||
if (finalPackagePath.StartsWith(expectedRoot) == false)
|
||||
{
|
||||
throw new IOException("Invalid path due to the package name");
|
||||
}
|
||||
|
||||
// Clean existing files
|
||||
foreach (var packagePath in new[] { definition.PackagePath, finalPackagePath })
|
||||
|
||||
Reference in New Issue
Block a user