-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
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
- 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/
- Deploy an SPFx package that stores its assets in a versioned folder on this CDN.
- Install and deploy the solution in the App Catalog.
- Check the Trusted Script Sources list.
- Notice that SharePoint automatically adds a new entry for the exact versioned CDN path, even though it matches the existing wildcard rule.
- Repeat deployments several times with a new versioned folder until the 300-entry limit is reached.
- Attempt to deploy a new SPFx package or update.
- 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.