abraxaslabs.tech · github.com/abraxas · @abraxas_null · [email protected] · CVE-2026-79752
技术分析文章:https://abraxaslabs.tech/research/CVE-2026-79752
CakePHP 5.2.13 - cakephp
我是 @abraxas_null。回环实验环境。客户端为 CVE-2026-79752-Abraxas-Labs.py。
CAST AS 字面量。FunctionsBuilder::cast(以及 extract / datePart / dateAdd)将调用方传入的 dataType / part / unit 作为未转义的结构拼接进 SQL。实验环境在 sqlite 上将 GET 参数 /?type= 传入 cast('body', $_GET['type'])。与 WordPress 无关。是 CVE-2026-77635(jsonValue / Postgres)的同类问题。已在 5.2.14、5.3.7、5.1.9、4.6.5、4.5.12 中修复。
| CVE | CVE-2026-79752 · CVE.org |
| CWE | CWE-89 |
| CVSS | 严重:9.2 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N |
| 产品 | CakePHP |
| 受影响版本 | 5.2.x 至 5.2.13(另含 4.5.x < 4.5.12、4.6.x < 4.6.5、5.1.x < 5.1.9、5.3.x < 5.3.7) |
| 已修复版本 | 5.2.14、5.3.7、5.1.9、4.6.5、4.5.12 |
| 认证 | 无 |
| 许可证 | GNU Affero GPL v3.0 |
| 实验环境 | 仅 127.0.0.1 |
如果应用程序将请求数据传入 func()->cast(..., $type)(或其他三个方法),调用方就能闭合 CAST 并 UNION 任意内容。实验环境泄露了 notes.body。这是 CakePHP 查询构建器中的 SQL 注入,而非 Postgres jsonpath 中的注入。
GHSA 点名了四个方法。我阅读了 cast,然后构建了一个将 GET 参数传入该方法的 sqlite 应用。
默认 GET / 为 CAST(body AS INTEGER) 和 [{"v":0}]。这是产品正常工作的表现。注入 GET 必须同时在 sql= 中放入片段 并且 返回 POCWitness79752。
走过的弯路:composer 500,因为镜像跳过了 composer install;从 PHP 源码中 grep 出 witness;注入 GET 后 sql= 仍然只有 CAST(body AS INTEGER)。
端口 8088。cakephp/database 5.2.13。实验应用位于 lab/lab-www。sqlite notes.body = POCWitness79752。
目标 仅限 127.0.0.1:8088(或你所绑定的回环地址)。
cd lab
docker compose up --force-recreate
python3 ../CVE-2026-79752-Abraxas-Labs.py
见证:HTTP body 中的 POCWitness79752 以及 sql= 中显示注入片段,而不仅仅是 CAST(body AS INTEGER)。
毫无收获的失败方式:
sql= 中没有注入片段将 CakePHP 更新至 5.2.14(或 5.3.7 / 5.1.9 / 4.6.5 / 4.5.12)。针对已修补的构建重新运行 CVE-2026-79752-Abraxas-Labs.py:注入片段不得出现在 sql= 中。
github.com/cakephp/cakephp/commit/3349584ca3a891afaff2dbc324d6b1c09fb880f0
github.com/cakephp/cakephp/commit/3f4d13ea4280067f3381ecf935a8bef5b7cdcc2e
github.com/cakephp/cakephp/commit/79e1d6bc6f3a50fa01805579076a02c77370c676
github.com/cakephp/cakephp/commit/8699d6f38e25fe46fcc24f2b698809948e71ad7d
github.com/cakephp/cakephp/commit/ab608711674ac662af7315c5cdf1e0fbe2000e45
github.com/cakephp/cakephp/security/advisories/GHSA-vjqc-q4mp-2rvf
github.com/CVEProject/cvelistV5/tree/main/cves/2026/79xxx/CVE-2026-79752.json
Abraxas Labs: abraxaslabs.tech · github.com/abraxas · @abraxas_null
GNU Affero GPL v3.0。参见 LICENSE。
该客户端仅与回环地址通信。将其用于您不拥有的系统并未获得 Abraxas Labs 的授权。不提供任何担保。