SharePoint and OneDrive Allow Anonymous Sharing Links

SharePoint and OneDrive let users create Anyone links, which give access to files and folders to whoever holds the link, without signing in or being identified.

SeverityMedium
CVSS 3.15.9 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N Open in the calculator
CVSS 4.08.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N Open in the calculator
CWECWE-552: Files or Directories Accessible to External Parties
OWASP Top 10A01:2025 Broken Access Control
MITRE ATT&CKT1213.002 Sharepoint, T1530 Data from Cloud Storage
CategorySecurity Misconfiguration

Description

The external sharing settings for SharePoint and OneDrive decide how far users can share content outside the organisation. The most permissive level, Anyone, lets users create links that work for whoever holds them, with no sign-in, so the person opening the content is never identified. The other levels require recipients to authenticate: new and existing guests, existing guests only, or only people in the organisation. OneDrive's level cannot be more permissive than SharePoint's, and individual sites can be restricted further but cannot exceed the organisation-wide level.

The finding applies where the organisation-wide level is Anyone, particularly where Anyone links do not expire, can grant edit rights or can be created for folders, or where an Anyone link is the default link type offered to users. A link is long and random, so an attacker needs the link itself, but once created it can be forwarded, pasted into tickets and chats, saved in browser history or published, and it keeps working for anyone who finds it until it expires or is removed. The exposure therefore depends on how widely such links are created and how carefully they are handled.

Anyone who obtains a link, whether through a forwarded email, a compromised mailbox, a public post or a search engine, can open the shared content without an account, and the organisation cannot tell who did so. A shared folder exposes everything later placed in it, and an edit link lets the holder change or replace content, for example to plant malicious documents for colleagues to open. Exposed content may include personal data, making the exposure a reportable breach.

The setting is identified in the organisation's SharePoint sharing settings, or with Get-SPOTenant, where SharingCapability is ExternalUserAndGuestSharing, and in the audit log, which records the creation and use of anonymous links.

Remediation

  • Lower the organisation-wide external sharing level for SharePoint and OneDrive to New and existing guests or more restrictive, so that every external recipient signs in and is identified.
  • Where Anyone links are needed for a specific business purpose, allow them only on designated sites, and set the link options so that they expire within a short period, give view-only access and, where possible, cannot be created for folders.
  • Set the default link type to people in the organisation or specific people, so that users do not create Anyone links by default.
  • Restrict external sharing to members of specific security groups where only some staff need it, and require MFA for guests through Conditional Access.
  • Review existing Anyone links using the audit log and sharing reports, and remove those that are no longer needed.

For example, with the SharePoint Online Management Shell:

Set-SPOTenant -SharingCapability ExternalUserSharingOnly Set-SPOTenant -DefaultSharingLinkType Internal

Where Anyone links must remain for now, set RequireAnonymousLinksExpireInDays, and set FileAnonymousLinkType and FolderAnonymousLinkType to View. Confirm the fix by attempting, as a standard user, to create an Anyone link, and finding that the option is not offered.

References


Add This Finding to Your Library

In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.

Free trial  ·  No card required

Only need the reporting? Our reporting tool is free and open source, with the same library.


More Azure and Microsoft 365 Findings

Every Azure and Microsoft 365 finding