Share via


Resolve false positive malware detections

False positive detections of malware in Microsoft SharePoint occur when a safe file is mistakenly identified as malware by Microsoft scanning engines. This article explains how to identify which feature flagged the file, how to report it for analysis, and how to unblock the file, if it's necessary. Although the information in this article focuses on files in SharePoint, it applies also to files that are stored on OneDrive and in Microsoft Teams.

Tip

Malware detection in SharePoint

SharePoint uses two main malware scanning engines:

  • Microsoft Defender for Office 365: Files are tested in a cloud virtual environment (also known as a sandbox). For more information, see Safe Attachments for SharePoint, OneDrive, and Microsoft Teams.
  • Microsoft Defender for Endpoint: Built-in virus protection that uses frequently updated signature-based detections.

File scanning isn't always immediate. Scanning occurs asynchronously based on such factors as file type and sharing status. If a file is detected as malware, access to the file is blocked, and a warning message appears.

Screenshot of a blocked file in SharePoint.

Handle and prevent false positives

Use the steps in this section to resolve false positives in SharePoint.

Step 1: Identify the engine that flagged the file

Use any of the following methods:

  • Simple: Use either of the following methods in the Defender portal:

  • Advanced: Use either of the following methods:

    • Microsoft Purview Audit: Review the audit log for FileMalwareDetected operations. By default, the log holds information for 180 days.

      • The AuditData column contains the VirusVendor field:
        • Default for signature-based detection
        • Advanced Threat Protection for Safe Attachments detection
      • The VirusInfo field contains the full name of the malware variant.

      For more information, see Search the audit log.

  • SharePoint Online PowerShell: Use the Get-SPOMalwareFile for details about the detection. The MalwareInfo field indicates the detection type. For example, Win32/CryptInject!MSR or Trojan_PDF_LinkedUrlCookie_A.

    • Signature detection malware variants include forward slashes ('/').
    • Safe Attachments detection malware variants include underscores ('_') or the text, Malicious Payload.

    For example:

    PS C:\WINDOWS\system32\> Get-SPOMalwareFile -FileUri 'https://contoso.sharepoint.com/sites/Everyone/Shared Documents/eic_order.log'
    
    File :               Microsoft.SharePoint.Client.File
    FilePath :           Microsoft.SharePoint.Client.ResourcePath
    MalwareInfo :        DOS/EICAR_Test_File
    MalwareStatus :      Infected
    SiteURL :            <https://contoso.sharepoint.com/sites/Everyone>
    Context :            Microsoft.Online.SharePoint.PowerShell.CmdLetContext
    Tag :
    Path :               Microsoft.SharePoint.Client.ObjectPathMethod
    ObjectVersion :
    ServerObjectIsNull : False
    TypedObject :        Microsoft.Online.SharePoint.TenantAdministration.SPOMalwareFile
    

Step 2: Submit files to Microsoft for analysis

If multiple files are flagged, submit all affected files by using the following steps.

  1. Download the files by using one of the following methods:

    Caution

    Downloading files that contain malware poses risks. Always adhere to your organization's security guidelines before you proceed.

  2. Submit the files by using one of the following methods, based on how the file was detected:

Step 3: Verify the outcome

If Microsoft identifies a false positive and updates the definitions, the file shouldn't be flagged again. If the file continues to be flagged, contact Microsoft Support, and specify whether the issue involves a single file or multiple files.

Unblock files

Important

Only unblock files that you're confident are safe.

Use any of the following methods:

Tip

  • Uploading a file again might restore access, but the file might also be flagged again unless the definitions are updated.

  • For files that are blocked for more than 30 days, contact Microsoft Support and provide the following information:

    • Evidence that the file is safe
    • The detection type
    • The file path from the relevant source:

    Here's an example path from the SharePoint library details: https://contoso.sharepoint.com/sites/Everyone/Shared%20Documents/General/MyDoc1.docx

    Screenshot of how to copy the path of a file in SharePoint

More information

Manage quarantined messages and files as an admin

Built-in virus protection in SharePoint, OneDrive, and Microsoft Teams

Safe Attachments for SharePoint, OneDrive, and Microsoft Teams

Report good email attachments to Microsoft