[WordPress] 外掛分享: CodePros SVG Secure Support

首頁外掛目錄 › CodePros SVG Secure Support
WordPress 外掛 CodePros SVG Secure Support 的封面圖片
全新外掛
安裝啟用
尚無評分
46 天前
最後更新
問題解決
WordPress 6.0+ PHP 7.4+ v1.0.0 上架:2026-06-14

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「CodePros SVG Secure Support」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

WordPress does not support SVG uploads natively — and naive SVG plugins are a well-known attack surface. SVG files are XML documents that can carry XSS payloads, XXE attacks, external resource injection, and embedded HTML. CodePros SVG Secure Support adds safe, production-ready SVG uploads through a layered defense pipeline.
Security Pipeline
Every uploaded SVG passes through five sequential checks before it is accepted:

Extension check — Blocks double-extension filenames (e.g. payload.php.svg) and enforces .svg only.
MIME check — Verifies actual file bytes return image/svg+xml via finfo; confirms width/height/viewBox; rejects unreasonably large declared dimensions (default 10,000 px).

After validation, the file is sanitized:

DOM sanitization via the battle-tested enshrined/svg-sanitize library with custom tag and attribute whitelists.
Remote reference stripping — all external URLs are removed.
Final string-level regex scan for javascript:,

延伸相關外掛

文章
Filter
Apply Filters
Mastodon