您絕對不能錯過的更新:Office 2016 與 Office 2019 支援終止

立即閱讀
我們利用人工智慧進行網站翻譯,雖然我們力求準確性,但它們可能並不總是 100% 精確。感謝您的理解。

How to Stop SVG-Based Phishing Attacks with Deep CDR™ Technology

by Vinh Lam,資深技術計畫經理
分享此文章

Attackers increasingly weaponize SVG files with embedded JavaScript and Base64‑encoded payloads to deliver phishing pages and malware while evading traditional detection. Deep CDR™ Technology, one of the core technologies that powers MetaDefender Core™, neutralizes this class of attack by removing all active content (scripts, external references, event handlers, etc.) and delivering a clean, standards‑compliant image that preserves functionality while eliminating risk. Normal, trustworthy SVGs (Scalable Vector Graphics) do not need JavaScript, so it is removed by default.

為何選擇 SVG

網路釣魚有效載荷的完美載具

SVG 是基於 XML 的向量影像格式,而非簡單的位圖。

SVG 程式碼的截圖,說明 svg 網路釣魚攻擊如何在向量影像中嵌入惡意有效載荷
SVG 的範例程式碼片段

SVG 檔案可包括

  • 腳本
  • 事件處理程式
  • 外部參考資料

這些功能對互動式圖形很有用,但攻擊者利用它們來:

  • 執行惡意程式碼
  • 注入惡意 XML 資料
  • 擷取外部內容
  • 偽造登入頁面

攻擊者還將 SVGs 與HTML/JS 走私結合,在看似無害的圖像中嵌入 Base64 有效負載,並在執行時將其解碼。此技術現在已被正式追蹤為 MITRE ATT&CK「SVG 走私」(T1027.017)。

主要心得

In normal enterprise content workflows (logos, icons, diagrams), SVGs don’t require JavaScript or active content. If you find <script>, event handlers, or remote references in an inbound SVG, treat them as risky.

我們在野外所見

含有 Base64 解碼釣魚網站的電子郵件附件

  • 傳送:例行電子郵件會帶有 .svg 附件,許多電子郵件閘道會將其視為影像。
  • Technique: Inside the SVG, an obfuscated <script> reconstructs a phishing page from a Base64 blob and loads it in the browser.

使用事件處理程式重定向的Drive網站

  • 傳送:受損或有錯字的網站會使用可點選區域的透明 SVG 疊層。
  • 技術:事件屬性 (onload, onclick) 使用 Base64 解碼觸發重定向。

為何 Detection 在此掙扎

傳統的方法,例如簽章、模式規則和靜態程式碼檢查,在攻擊者攻擊時會失敗:

  • 使用 Base64、XOR、垃圾文字襯墊或多態範本進行混淆。
  • 延遲執行到執行時 (例如 onload),使靜態分析變得不可靠。
  • 隱藏合法 SVG 功能背後的邏輯,例如事件處理程式和外部參考。

有趣的事實

根據 HTTP Archive 的資料顯示,前 1000 個網站中有 92% 的圖示和圖形使用 SVG。

"如果活躍,就有風險

Deep CDR™ Technology for SVG

Deep CDR™ Technology, one of the core technologies that powers MetaDefender Core, doesn’t try to guess what is malicious. It assumes any executable or active content in untrusted files is risky and removes or sanitizes it.

對 SVG 而言,這意味著

  • Remove JavaScript: Strips out any <script> elements and inline scripts to prevent code execution.
  • 移除 CDATA:消除 CDATA 區段內可能嵌入有害邏輯的隱藏程式碼。
  • 移除注入內容:攔截可能執行惡意程式的注入內容。
  • 處理影像:反復消毒嵌入式影像並移除外部影像。
  • 規範化與重建:建立符合標準的 SVG,只包含安全的視覺元素。
  • 可選擇光柵化:針對不需要向量互動的工作流程,將 SVG 轉換為 PNG 或 PDF。

此方法符合安全指引:對 SVGs 進行 sanitize 或 sandbox(或光柵化),以防止程式碼執行。

Top Use Cases with Deep CDR™ Technology

電子郵件閘道

在傳送之前淨化入站(inbound)附件和連結檔案(透過下載解決的 URL)。轉換為淨化 SVG 的 SVG 可防止憑證擷取程式渲染和下載程式啟動。

協作平台

Apply Deep CDR™ Technology to files shared through tools like Teams, Slack, or SharePoint. Sanitizing SVGs here ensures that no hidden login screens or malicious scripts can trick users during everyday collaboration.

網頁上傳入口網站

對上傳至網站、CMS 或數位資產管理系統的所有檔案強制執行淨化。這可防止攻擊者在看似簡單的標誌或圖形中隱藏有害程式碼。

檔案傳輸與MFT Managed File Transfer

Integrate Deep CDR™ Technology into file transfer workflows so every file, especially those from partners or vendors, is safe to use before entering your network. This reduces supply chain risks from compromised assets.

商業影響

忽略 SVG sanitization 可能會導致:

  • 憑證盜用:虛假登入頁面竊取用戶憑證。
  • 惡意軟體感染:重定向鏈會傳送贖金軟體或竊取程式。
  • 違反法規:涉及敏感資料的違規行為可能引發罰款和聲譽損害。

預防 SVG 攻擊的最佳作法

  • 預設立場:不允許在未信任來源的 SVG 中使用 JavaScript。
  • Sanitize or rasterize: Apply Deep CDR™ Technology to all inbound SVG files.
  • 結合 CSP:作為深度防禦,而非主要控制。
  • 稽核與記錄:追蹤每項清除動作,以符合法規要求並進行鑑識。

結束語

SVG-based phishing is not theoretical, it’s happening now. Detection-based tools can’t keep up with evolving obfuscation techniques. Deep CDR™ Technology offers a deterministic, zero-trust approach, removing the risk before it reaches your users.

隨時瞭解OPSWAT 的最新資訊!

立即註冊,即可收到公司的最新消息、 故事、活動資訊等。