How SharePoint Online Handles Malware-Infected Files
Question details
Understand how SharePoint Online identifies infected files and handles attempts to download them.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A user or administrator wants to know what happens when malware is detected in a SharePoint document library.
- Observed behavior
- Detected files can be flagged in the library, and users may receive a warning when attempting to download them. Administrators can block infected file downloads.
Identify the affected file and document library, and check whether SharePoint has displayed a malware warning. Administrative changes require appropriate SharePoint administrator permissions and the SharePoint Online Management Shell.
Recognize and report a file flagged as infected
Use this approach when SharePoint displays a malware warning for a library file.
SharePoint Online scans files for known malware, but scanning is not instantaneous and does not guarantee detection of every threat. A flagged file may remain visible in the library; do not assume it has been moved to a separate location.
Open the SharePoint document library and look for a warning or alert icon next to the affected file.
If a warning appears when you select or attempt to download the file, cancel the download and do not open the file.
Send your Microsoft 365 or SharePoint administrator the file name, library location, and warning details so they can investigate and decide how to remove or remediate it.
Block downloads of detected infected files
SharePoint administrators can use PowerShell to check and enforce the infected-file download restriction.
Work with cleared Office documents in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for moving your document work from Microsoft Office. It does not manage SharePoint malware detection or download restrictions; use it only with files your administrator has cleared.

Frequently Asked Questions
Does SharePoint Online scan every uploaded file immediately?
No. Malware scanning is not necessarily immediate, and detection is not guaranteed for every threat. Continue to use endpoint protection and follow your organization's security policies.
Can users download a file that SharePoint flags as infected?
It depends on the tenant setting. A SharePoint administrator can check DisallowInfectedFileDownload with Get-SPOTenant and set it to true to block downloads of detected infected files.
Is a detected file automatically moved out of the document library?
Do not assume it has been moved. A flagged file can remain visible in the library with an alert or warning; ask an administrator to investigate it.
What should I do if I see a malware warning on a SharePoint file?
Cancel any download attempt and report the file name, library location, and warning to your SharePoint or Microsoft 365 administrator.




