Skip to content

SharePoint Ignores Wildcard CSP Rules, Auto-Creates Script Sources and Blocks SPFx Deployments #10512

@jbolliet-mozzaik365

Description

@jbolliet-mozzaik365

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

other (enter in the "Additional environment details" area below)

Developer environment

Windows

What browser(s) / client(s) have you tested

  • 💥 Internet Explorer
  • 💥 Microsoft Edge
  • 💥 Google Chrome
  • 💥 FireFox
  • 💥 Safari
  • mobile (iOS/iPadOS)
  • mobile (Android)
  • not applicable
  • other (enter in the "Additional environment details" area below)

Additional environment details

  • SharePoint admin center > Trusted script sources

Describe the bug / error

SharePoint Online automatically adds new entries to the Trusted Script Sources list when deploying updated SharePoint Framework (SPFx) packages, even though a generic wildcard rule already exists for the same CDN domain.

In my tenant, I have intentionally configured broad CSP rules such as:

  • https://cdn.{my-company}.net/*
  • https://cdn.{my-company}.net/

These entries should allow all JavaScript assets hosted anywhere under this CDN domain.
However, each time a new SPFx package version is deployed, SharePoint automatically creates a new CSP entry corresponding to the specific asset folder used in that package (e.g., versioned folders like /releases/2025.12.3.64390/).

This behavior causes the number of CSP entries to grow indefinitely, eventually hitting the 300-entry limit for the Trusted Script Sources page. As we deploy updates several times a week across multiple customers, this limit will be reached very quickly.

Therefore, the automatic creation of entries appears to ignore existing wildcard CSP rules, which is not the expected behavior and creates a scalability issue for ongoing SPFx deployments.

Critical issue:
Once this limit is reached, SharePoint Online blocks the deployment of any new SPFx packages or package updates in the App Catalog. This means we are no longer able to deploy bug fixes, enhancements, or new versions of our solutions.

Since our solutions are deployed across several hundred customers, this issue has a very large operational impact and prevents us from maintaining our products.

Steps to reproduce

  1. In SharePoint Admin Center → Content Security Policy, add a wildcard CSP rule for a CDN, e.g.:
    • https://cdn.{my-company}.net/*
    • or https://cdn.{my-company}.net/
  2. Deploy an SPFx package that stores its assets in a versioned folder on this CDN.
  3. Install and deploy the solution in the App Catalog.
  4. Check the Trusted Script Sources list.
  5. Notice that SharePoint automatically adds a new entry for the exact versioned CDN path, even though it matches the existing wildcard rule.
  6. Repeat deployments several times with a new versioned folder until the 300-entry limit is reached.
  7. Attempt to deploy a new SPFx package or update.
  8. Observe that deployment fails, because no more CSP entries can be added.

Expected behavior

SharePoint Online should:

  • Respect existing wildcard CSP rules.
  • Avoid creating redundant Trusted Script Source entries when a URL is already covered by a wildcard domain.
  • Prevent the CSP list from growing unnecessarily and hitting the 300-entry limit.

If wildcard entries were respected, the number of CSP entries would remain stable, and we would be able to continue deploying updates without interruption.

This behavior is essential for environments with frequent SPFx deployments, especially when supporting hundreds of customer tenants.

Metadata

Metadata

Labels

area:cdnCategory: Office 365 Content Delivery Networkarea:spfxCategory: SharePoint Framework (not extensions related)sharepoint-developer-supportsharepoint-developer-supportstatus:by-designTopic described is by design & not considered an issue.type:bug-suspectedSuspected bug (not working as designed/expected). See “type:bug-confirmed” for confirmed bugs.type:uservoice-requestEnhancements & feature requests should be posted: http://aka.ms/sp-dev-uservoice

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions