從 IDictionary 繼承的某些類型會遭到封鎖,無法還原序列化 (KB5043462)

套用到
SharePoint Server Subscription Edition SharePoint Server 2019 SharePoint Server 2016

症狀

在套用 SharePoint Server 的 2024 年 9 月安全性更新之後,部分繼承自 IDictionary 的類型遭到封鎖而無法還原序列化。 當此問題發生時,以下錯誤訊息及「4nsby」或「4nss4」事件標籤會被記錄在 SharePoint 統一日誌系統 (ULS) 日誌中:

注意

偵測到不支援的 IDictionary 類型。 類型: <類型>,組裝: <組裝>

原因

發生此問題是因為此類型不在還原序列化的允許清單中。

因應措施

如果問題在 w3wp.exe 程序中發生,陣列系統管理員可以透過在 Web.config 檔案中的信任清單中新增封鎖類型來解決此問題,但您必須確定這些類型是安全的。

為此,新增一個名為 AllowedIDictionaryType 的新 AllowedItem 元素,並指定 TypeAssembly 屬性。 應將此元素新增於 Web.config 檔案中的 configuration/SharePoint/SafeMode/AllowedListItems 區段底下。 下列是範例:

<SafeMode

            MaxControls = "200" 

            CallStack = "false"

            DirectFileDependencies ="10"

            TotalFileDependencies = "250"

            AllowPageLevelTrace = "false"

            ControlCompatMode="false"

            >

            <PageParserPaths>

            </PageParserPaths>

         <AllowedListItems>

                     <AllowedItem Name="AllowedIDictionaryType" Type="Microsoft.SharePoint.Portal.WebControls.RSSAggregatorWebPart, Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/>

                   <AllowedItem Name="AllowedIDictionaryType" Assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxx"/>

         </AllowedListItems>

</SafeMode>