diff --git a/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py b/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py index 09fd14453..4c7662b0c 100644 --- a/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py +++ b/monkey/monkey_island/cc/repository/file_storage/local_storage_file_repository.py @@ -76,7 +76,9 @@ class LocalStorageFileRepository(IFileRepository): # This is a paranoid check to avoid directory traversal attacks. if self._storage_directory.resolve() not in safe_file_path.parents: - raise ValueError(f"The file named {unsafe_file_name} can not be safely retrieved") + raise ValueError( + f'The file named "{unsafe_file_name}" cannot be safely retrieved or written' + ) logger.debug(f"Untrusted file name {unsafe_file_name} sanitized: {safe_file_path}") return safe_file_path