目标达成 感谢每一位支持者 — 我们达成了 100% 目标!

目标: 1000 元 · 已筹: 1359 元

100%

CVE-2023-37478 PoC — pnpm 访问控制错误漏洞

来源
关联漏洞
标题: pnpm 访问控制错误漏洞 (CVE-2023-37478)
Description:Github PNPM是快速、节省磁盘空间的包管理器。 pnpm 7.33.4 之前版本和 8.6.8之前版本存在访问控制错误漏洞,该漏洞源于在 npm 注册表上或通过 npm 安装时显示为安全的包在通过 pnpm 安装时被受损或恶意版本替换。
Description
CVE-2023-37478 showcases how a difference in npm and pnpm install packages that could be exploited by a well crafted tar.gz packge. This repo shows a demo. 
介绍
# `pnpm` vs `npm` exploit 

This repo showcases how a difference in `npm` and `pnpm`installation from tarballs can be exploited. 
The exploit is recorded in [CVE-2023-37478](https://nvd.nist.gov/vuln/detail/CVE-2023-37478).

The javascript package constructed here claims it prints out a nice message to the user. When installed with `npm`, this is true. 
However, the same package can be installed with `pnpm` and it will print out a mean message. 
One could imagine how this could be more maliciously exploited. 

You can find an old, vulnerable version of pnpm [here](https://github.com/pnpm/pnpm/releases/tag/v8.6.7) that works with this exploit. 
This is fixed in [newer versions of pnpm](https://github.com/pnpm/pnpm/security/advisories/GHSA-5r98-f33j-g8h7) and the fix can be [seen here](https://github.com/pnpm/pnpm/commit/250f7e9fe90359e2b3b01ba8294c4120445e5aa6#diff-0d65e839be9422dce3b76fb31562012c3c205698db6260764ea96ca8811d0344)

## How to use this Repo

`exploitative_package_src` has the source for the package `definitely_benign_package`.
The folder `bad_version` (V0.1) contains malicious code, and `good_version` (V0.2) contains good code.
`make_tar.sh` builds the tar package such that the bad version is added to the tarbal before the good version.

For a demo, move/clone the compiled `definitely_benign_package.tgz` into `/use_demonstration/` and install via `npm` or `pnpm`, this can be shortcut with `make pnpm/npm` (`make clean` also works once you're done).
Once it's installed, run the words of affirmation script with `node words_of_affirmation.js`. 
文件快照

登录后查看神龙缓存的 POC 文件快照

登录查看
备注
    1. 建议优先通过来源进行访问。
    2. 本地 POC 快照面向订阅用户开放;当原始来源失效或无法访问时,本地镜像作为订阅权益的一部分提供。
    3. 持续抓取、验证、维护这份 POC 档案需要不少投入,因此本地快照已纳入付费订阅。您的订阅是让这份资料能继续走下去的关键,由衷感谢。 查看订阅方案 →