| Gói / sản phẩm | Phiên bản bị ảnh hưởng | Phiên bản đã vá |
|---|---|---|
| pnpm | < 10.26.0 | 10.26.0 |
| pnpm | < 10.26.0 | 10.26.0 |
HTTP tarball dependencies (and git-hosted tarballs) are stored in the lockfile without integrity hashes. This allows the remote server to serve different content on each install, even when a lockfile is committed.
When a package depends on an HTTP tarball URL, pnpm's tarball resolver returns only the URL without computing an integrity hash:
resolving/tarball-resolver/src/index.ts:
return {
resolution: {
tarball: resolvedUrl,
// No integrity field
},
resolvedVia: 'url',
}
The resulting lockfile entry has no integrity to verify:
remote-dynamic-dependency@http://example.com/pkg.tgz:
resolution: {tarball: http://example.com/pkg.tgz}
version: 1.0.0
Since there is no integrity hash, pnpm cannot detect when the server returns different content.
This affects:
"pkg": "https://example.com/pkg.tgz")"pkg": "github:user/repo")"pkg": "git+https://github.com/user/repo")npm registry packages are not affected as they include integrity hashes from the registry metadata.
See attached pnpm-bypass-integrity-poc.zip
The POC includes:
malicious-package that depends on the HTTP tarballvictim project that depends on malicious-packageTo run:
cd pnpm-bypass-integrity-poc
./run-poc.sh
The output shows that each install (with pnpm store prune between them) downloads different code despite having a committed lockfile.
An attacker who publishes a package with an HTTP tarball dependency can serve different code to different users or CI/CD environments. This enables:
The attack requires the victim to install a package that has an HTTP/git tarball in its dependency tree. The victim's lockfile provides no protection.
Bạn đang dùng một trong các sản phẩm này? Quét site để biết có đang lộ phiên bản có lỗ hổng không.
Quét site miễn phí