1. 簡介

Sitecore Experience Platform (XP) 是一個廣泛採用的企業級內容管理系統 (Content Management System, CMS),全球眾多組織都在使用。鑑於它在企業環境中的普及和廣泛部署,這個平台的安全性至關重要。這份技術報告檢視了最近在 Sitecore XP 中發現的三個漏洞,它們可以被串連起來以達成 pre-authentication cache poisoning 和 post-authentication remote code execution,最終導致系統的完整被入侵。

這份報告討論的漏洞包括 CVE-2025-53693 (透過不安全的反射進行 HTML cache poisoning)、CVE-2025-53691 (透過不安全的反序列化 進行 remote code execution) 以及 CVE-2025-53694 (ItemServices API 的資訊洩露)。這些漏洞是在 Sitecore Experience Platform 版本 10.4.1 rev. 011628 中發現的,且 Sitecore 已於 2025 年 6 月和 7 月更新。

這份報告提供了這些漏洞的技術分析、攻擊機制以及對受影響系統的潛在影響。研究顯示攻擊者如何結合這些缺陷來污染 HTML cache 項目,並在沒有事先 authentication credentials 的情況下達成 remote code execution。

你的網站正在被「下毒」嗎?從 Sitecore XP 漏洞,學會如何反制駭客入侵 | 資訊安全新聞

2. 漏洞技術分析

CVE-2025-53693: 透過不安全的反射進行 HTML Cache Poisoning

HTML cache poisoning 漏洞存在於 Sitecore.Web.UI.XamlSharp.Xaml.XamlPageHandlerFactory HTTP handler 中,該 handler 在 web.config 檔案中註冊,並可透過 /-/xaml/ 的 endpoint 請求在 pre-authentication 狀態下存取。

這個漏洞顯現於 XamlPageHandlerFactory 類別的 GetHandler 方法中:

  1. public IHttpHandler GetHandler(HttpContext context, string requestType, string url, string pathTranslated)
  2. {
  3. Assert.ArgumentNotNull(context, "context");
  4. Assert.ArgumentNotNull(requestType, "requestType");
  5. Assert.ArgumentNotNull(url, "url");
  6. Assert.ArgumentNotNull(pathTranslated, "pathTranslated");
  7. int indexOfFirstMatchToken = url.GetIndexOfFirstMatchToken(new List<string>
  8. {
  9. "~/xaml/",
  10. "-/xaml/"
  11. }, StringComparison.OrdinalIgnoreCase);
  12. if (indexOfFirstMatchToken >= 0)
  13. {
  14. return XamlPageHandlerFactory.GetXamlPageHandler(context, StringUtil.Left(url, indexOfFirstMatchToken)); // [1]
  15. }
  16. // Additional code omitted for brevity
  17. }

[1] ,此方法呼叫 GetXamlPageHandler ,它會回傳實作 IHttpHandler 介面的 handler 物件。這個 handler 會處理位於 Sitecore 安裝各處的 .xaml.xml 檔案,例如 sitecore/shell/Applications/Xaml

關鍵的攻擊向量是透過 XAML 定義檔案中引用的 AjaxScriptManager control:

<AjaxScriptManager runat="server" />

這個 control 繼承了 .NET WebControl,導致其 OnPreRender 方法在頁面初始化時執行:

  1. protected override void OnPreRender(EventArgs e)
  2. {
  3. Assert.ArgumentNotNull(e, "e");
  4. base.OnPreRender(e);
  5. if (!this.IsEvent)
  6. {
  7. this.PageScriptManager.OnPreRender();
  8. return;
  9. }
  10. System.Web.UI.Page page = this.Page;
  11. if (page == null)
  12. {
  13. return;
  14. }
  15. page.SetRenderMethodDelegate(new RenderMethod(this.RenderPage));
  16. this.EnableOutput();
  17. this.EnsureChildControls();
  18. string clientId = page.Request.Form["__SOURCE"]; // [1]
  19. string text = page.Request.Form["__PARAMETERS"]; // [2]
  20. // Additional processing logic
  21. }

該漏洞發生在 [1] [2] ,程式碼直接從 HTTP request 的 form 資料中取出 __SOURCE __PARAMETERS 的值,且沒有進行適當的驗證。這些值隨後會傳遞給處理 control 執行的 Dispatch 方法。

graph TD A[Attacker sends crafted request to /-/xaml/ endpoint] --> B[XamlPageHandlerFactory processes request] B --> C[AjaxScriptManager.OnPreRender executes] C --> D[Unsafe retrieval of __SOURCE and __PARAMETERS] D --> E[Dispatch method invoked with attacker values] E --> F[Reflection mechanisms resolve controls] F --> G[Arbitrary control execution] G --> H[HTML output poisoned in cache]
CVE-2025-53691: Remote Code Execution Through Insecure Deserialization

remote code execution 漏洞源於 Sitecore 平台內不安全的反序列化 做法。雖然這個特定漏洞的技術細節在可用的資源中沒有完全揭露,但過去對 Sitecore deserialization 漏洞的研究為理解潛在的攻擊向量提供了環境。

不安全的反序列化漏洞 通常發生在應用程式在沒有適當驗證的情況下 deserialize 不可信任的資料時,導致攻擊者可以在 deserialization 程序中執行任意程式碼。在 Sitecore 的環境下,這通常涉及 deserialization ViewState 參數或其他 serialized objects。

這個漏洞的利用很可能涉及製作惡意 serialized objects,當被應用程式 deserialize 時,觸發攻擊者控制的程式碼執行。這個漏洞需要 authentication 才能直接利用,但當與 cache poisoning 漏洞串連時,攻擊者可以透過被污染的 cache 項目向已經認證的用戶發送 payload。

CVE-2025-53694: Information Disclosure in ItemServices API

ItemServices API 中的資訊洩露漏洞允許受限的匿名使用者列舉存儲在 Sitecore cache 中的 HTML cache keys。這個漏洞讓攻擊者能夠識別出可作為 poisoning 攻擊目標的有效 cache keys。

技術機制涉及繞過存取控制或利用 ItemServices API endpoints 中不充足的 authentication 檢查。透過系統性地查詢這些 endpoints,攻擊者可以收集關於 cache keys 及其內容的資訊,從而促進更精確的 cache poisoning 攻擊。

3. 攻擊鏈分析

當這些單獨的漏洞在一次協調攻擊中被串連在一起時,它們變得特別危險。完整的 攻擊鏈 透過特定順序結合這些漏洞,實現了 pre-authentication remote code execution:

1

Information Gathering

攻擊者首先利用 CVE-2025-53694 (Information Disclosure in ItemServices API) 來列舉存儲在 Sitecore cache 中的有效 HTML cache keys。這為攻擊者提供了 cache poisoning 的具體目標。

2

Cache Poisoning

使用發現的 cache keys,攻擊者利用 CVE-2025-53693 (HTML Cache Poisoning) 將惡意內容注入 cache。這個內容通常包括旨在觸發 remote code execution 漏洞的 JavaScript payloads。

3

Payload Delivery

當經過身份驗證的使用者造訪中毒頁面時,惡意內容將從快取中提供,並在經過驗證的使用者會話的上下文中執行。

4

Code Execution

JavaScript payload 觸發 CVE-2025-53691(不安全反序列化 RCE)的攻擊,以應用程式集區身分的權限在伺服器上執行任意程式碼。

這個 攻擊鏈 證明了攻擊者如何利用多個漏洞來達成 pre-authentication remote code execution,儘管有些漏洞在單獨攻擊時需要 authentication。

sequenceDiagram participant A as Attacker participant S as Sitecore Server participant C as Cache System participant U as Authenticated User A->>S: Exploit Info Disclosure (CVE-2025-53694) S-->>A: Return cache keys A->>S: Send poisoning request (CVE-2025-53693) S->>C: Store poisoned content U->>S: Request legitimate page S->>C: Retrieve poisoned content S-->>U: Serve poisoned response U->>S: Execute malicious JavaScript S->>S: Trigger deserialization (CVE-2025-53691) S->>S: Execute arbitrary code

4. 緩解策略

根據對這些漏洞的分析,建議採取以下緩解策略:

立即更新

應用 Sitecore 於 2025 年 6 月和 7 月發布的最新安全更新程式,以解決這些特定的漏洞。

輸入驗證

對所有參數實施嚴格的輸入驗證,特別是那些從 HTTP request 的 form 資料中檢索取出的參數,例如 __SOURCE __PARAMETERS

Deserialization Controls

僅限於可信任的資料進行 deserialization,並在 deserialization 程序期間實施驗證檢查。

存取控制

審查並加強 API endpoints 的存取控制,特別是 ItemServices API,以防止資訊洩露給未經授權的使用者。

Cache Validation

對 cache 內容實施額外的驗證檢查,以偵測並防止提供惡意內容。

Network Segmentation

應用 network segmentation 來限制成功攻擊的潛在影響,特別是限制對敏感系統的存取。

Monitoring and Detection

實施健全的監控解決方案,以偵測攻擊嘗試,特別是針對 xaml handlers 或 ItemServices API 的不尋常存取模式。

5. 結論

在 Sitecore Experience Platform 中發現這些漏洞,凸顯了保護複雜內容管理系統的持續挑戰。資訊外洩、快取中毒和不安全反序列化等多​​個漏洞的串聯表明了攻擊者為實現預認證遠端程式碼執行而採用的複雜技術。

這份分析強調了全面性安全評估的重要性,不僅要考慮單個漏洞,還要考慮它們在順序利用時的潛在互動。縱深防禦策略(Defense-in-depth strategies)、定期安全更新和主動監控是企業 CMS 部署強大安全態勢的重要組成部分。

需要進一步研究以探索內容管理系統中的額外攻擊面,並開發更有效的緩解技術來對抗 cache poisoning 和 deserialization attacks