What "SharePoint ransomware" actually means
SharePoint itself rarely gets "infected." Ransomware reaches your SharePoint data in one of two ways.
The first is through a person's laptop. Someone opens a bad attachment, the malware encrypts every file it can reach, and the OneDrive sync client faithfully uploads the scrambled versions to SharePoint. The cloud copy is now ruined too.
The second is through the server. If you run SharePoint Server on-premises, attackers can exploit unpatched vulnerabilities and land directly on the machine that hosts your files.
Those two paths need different defenses. Most advice blurs them together, which is why it often fails.
The on-premises problem
In July 2025, attackers began exploiting a SharePoint Server flaw tracked as CVE-2025-53770, nicknamed "ToolShell." It affected on-premises servers, not SharePoint Online. Microsoft said at least one of the groups using it, which it tracks as Storm-2603, deployed Warlock ransomware.
The lesson isn't about one bug. Internet-facing SharePoint Server is a high-value target, and the gap between a patch being released and an attack being tried can be a few days.
If you run it on-premises, here's the minimum:
- Patch critical SharePoint updates within 72 hours of release. Within 24 hours is better for anything flagged as actively exploited. That's a rule of thumb, not a measured figure, but it matches how quickly exploit code tends to circulate.
- Turn on AMSI integration in full mode if your version supports it, and run endpoint protection on the servers themselves.
- After a serious exploit like ToolShell, rotate the ASP.NET machine keys and restart IIS. Patching alone doesn't remove access an attacker already took.
- Keep SharePoint servers off direct internet exposure when you can. Put them behind a reverse proxy or require VPN access.
Honestly, if you have fewer than a few hundred users and no hard regulatory reason to stay on-premises, I'd move to SharePoint Online and stop patching servers. Running the farm yourself is a lot of work for a small team, and it's work that attackers are watching.
The sync problem
For most organizations, this is the real risk. Ransomware on a laptop doesn't need to hack SharePoint. It just edits files that are already synced.
You can shrink the damage in three ways:
- Limit what syncs. Most people need five or ten libraries on their device, not the whole tenant. Use Files On-Demand so files stay in the cloud until opened. Encrypted files that were never downloaded can't be encrypted locally.
- Limit who can edit. Someone with Edit permission on a 40,000-file library can lose all 40,000 files to one bad click. Give most people Read access on archives and reference material.
- Block unmanaged devices from syncing. A conditional access policy that allows sync only from compliant or domain-joined machines closes the biggest hole. A personal laptop with no endpoint protection is where many incidents begin.
Multifactor authentication matters here too, though it protects against stolen passwords, not infected endpoints. Turn it on anyway.
What Microsoft gives you built in
SharePoint Online has real recovery tools. You should know their limits before you depend on them.
- Version history. By default, a library keeps up to 500 major versions of each file. Encrypted overwrites count as new versions, so older clean versions are usually still there. But restoring them one file at a time doesn't scale.
- Recycle bin. Deleted items stay for 93 days across both stages. That helps with deletions, not with overwrites.
- Restore this library. Site owners can roll an entire library back to any point in the last 30 days. It's the best native tool you have, and it's easy to overlook.
- Ransomware detection. Microsoft 365 can flag mass-encryption patterns in OneDrive and prompt the user to restore. It's useful, but treat it as a smoke alarm, not a fire department.
Thirty days sounds generous. It isn't if an attacker sits quietly in your environment for six weeks, or if the damage goes unnoticed through a holiday. Native tools also share the same tenant, the same admin accounts, and the same failure modes. If an attacker gets a Global Administrator login, they can delete things in ways you can't undo.
Back it up outside the tenant
This is where I'll take a firm position: buy a third-party Microsoft 365 backup. Don't rely on the recycle bin and version history as your plan.
Microsoft's own service agreement describes a shared responsibility model. They keep the service running. Protecting your data from your own mistakes and attackers is on you.
Pricing varies by vendor and user count, but a rough range is $2 to $5 per user per month, so a 200-person company pays somewhere around $5,000 to $12,000 a year. That's a rule of thumb, so get quotes. Compare it against a week of lost work for 200 people, and it pays for itself in the first incident.
What to look for:
- Backup frequency. Daily is the floor. For sites where people work all day, every 4 to 8 hours is a sensible target.
- Retention. At least 90 days, ideally a year. Slow-burn incidents need that runway.
- Separate credentials. The backup console shouldn't use the same admin accounts as your tenant. Otherwise one stolen login takes out both.
- Immutable storage. Backups that can't be altered or deleted for a set period, even by an admin.
- Granular restore. You want to bring back one site or one library, not the whole tenant.
I wouldn't bother with exporting copies of libraries to a file share on a schedule. It sounds cheap, but it's slow to restore, easy to forget, and the share itself often becomes the next thing encrypted.
Practice the restore
A backup you've never restored is a hope.
Once a quarter, pick a mid-sized site, say 5 to 20 GB, and restore it into a test location. Time it. Write the time down. If restoring one site takes four hours, you now know that restoring forty will not happen by Tuesday.
Also record who has the authority to declare an incident and who can reach the backup console on a bad day. Print it. Your email might be down.
A short checklist
Here's what I'd do, in order, if I inherited a SharePoint environment tomorrow:
- Confirm whether you're on-premises or online, and patch or migrate accordingly.
- Require MFA for every account, and tighten admin roles to as few people as possible.
- Restrict sync to managed devices.
- Audit permissions on your five largest libraries and cut unnecessary Edit rights.
- Set up an independent backup with at least 90 days of retention.
- Test a restore this month, then every quarter.
None of this is exotic. Most ransomware incidents that hurt badly come down to one missing item on that list, not to some brilliant attack.
When it happens anyway
If you suspect encryption is underway, act in minutes, not hours.
Disconnect the affected device from the network and pause OneDrive sync. Disable the user's account and revoke their sessions. Then identify the earliest sign of bad changes in the audit log, because that timestamp is your restore point.
Restore the library to a time just before it. Verify a sample of files by opening them, not just checking that they exist. Then find out how the malware got in before you let anyone back on.
Speed matters, and so does knowing your restore point. Both come from preparation done long before the call.