diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index 093792cd0..22155cd0f 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -260,6 +260,26 @@ namespace NzbDrone.Core.MediaFiles var extension = Path.GetExtension(fileInfo.Name); + if (FileExtensions.DangerousExtensions.Contains(extension)) + { + return new List + { + new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName }, + new ImportRejection(ImportRejectionReason.DangerousFile, "Caution: Found potentially dangerous file")), + $"Caution: Found potentially dangerous file") + }; + } + + if (FileExtensions.ExecutableExtensions.Contains(extension)) + { + return new List + { + new ImportResult(new ImportDecision(new LocalEpisode { Path = fileInfo.FullName }, + new ImportRejection(ImportRejectionReason.ExecutableFile, "Caution: Found executable file")), + $"Caution: Found executable file") + }; + } + if (extension.IsNullOrWhiteSpace() || !MediaFileExtensions.Extensions.Contains(extension)) { _logger.Debug("[{0}] has an unsupported extension: '{1}'", fileInfo.FullName, extension);