CVE-2023-37478
pnpm incorrectly parses tar archives relative to specification
Что произошло
### Summary It is possible to construct a tarball that, when installed via npm or parsed by the registry is safe, but when installed via pnpm is malicious, due to how pnpm parses tar archives. ### Details The TAR format is an append-only archive format, and as such, the specification for how to update a file is to add a new record to the end with the updated version of the file. This means that it is completely valid for an archive to contain multiple copies of, say, `package.json`, and the expected behavior when extracting is that all versions other than the last get ignored. This is further complicated by that during tarball extraction, all package managers are configured to drop the first path component, so collisions can be created simply by using multiple root folders in the archive, even without performing updates. When pnpm extracts a tar archive via tar-stream, it appears to extract only the _first_ file of a given name and discards all subsequent files with the same name. ### PoC Create a root folder with the following layout: - `a/package.json` - `package/package.json` - `z/package.json` File contents: #### a/package.json ```json { "name": "test-package", "version": "0.1.0", "description": "This is a bad version of a test package", "dependencies": { "react": "^15" } } ``` #### package/package.json ```json { "name": "test-package", "version": "0.1.0", "description": "This is a bad version of a test package", "dependencies": { "react": "^16" } } ``` #### z/package.json ```json { "name": "test-package", "version": "0.1.0", "description": "This is the good version of a test package", "dependencies": { "react": "^17" } } ``` Then use the tar binary to produce a tarball (working directory is the root folder): `tar -c -z --format ustar -f package.tgz a package z` The order of the folders at the end matters; whichever one is last will end up being the package.json that wins when extracted by npm; the one that is first will be the one that wins when extracted by pnpm. Install the tarball via the `file:` protocol. Observe that with npm, the lockfile has `react@17`, while with pnpm it has `react@15`. ### Impact This can result in a package that appears safe on the npm registry or when installed via npm being replaced with a compromised or malicious version when installed via pnpm.
Что это значит
В источнике описана ошибка безопасности в перечисленных продуктах. Фактический риск зависит от установленной версии, конфигурации и доступности компонента; проверьте условия в первичном бюллетене.
Что делать
1. Проверьте, затронуты ли вы
Соберите инвентаризацию и сравните с таблицей затронутых версий. Эти команды только показывают установленные компоненты и сами по себе не доказывают наличие CVE.
dpkg-query -W -f='${Package} ${Version}\n'rpm -qa --qf '%{NAME}\t%{VERSION}-%{RELEASE}\n'Get-HotFix | Select-Object HotFixID, InstalledOn
2. Установите исправление
Сверьте точный продукт и версию с бюллетенем вендора. Установите указанное в нём исправление после резервного копирования и проверки совместимости. Подтверждённая целевая версия в источниках отсутствует.
3. Временные меры
До проверки бюллетеня ограничьте доступ к затронутому компоненту доверенными узлами. Оцените сегментацию и отключение ненужных интерфейсов с владельцем сервиса; универсального правила WAF для этой CVE не подтверждено.
4. Проверьте следы эксплуатации
Проверьте аномальные входы, новые учётные записи, ошибки и необычные дочерние процессы в затронутом сервисе. Публичные проверенные правила обнаружения не включены в запись; отсутствие сигналов не доказывает отсутствие компрометации.
5. После исправления
- Проверьте фактическую версию и результат установки по бюллетеню.
- При необходимости перезапустите сервисы в согласованное окно.
- Повторите проверку сканером и функциональные проверки.
- Зафиксируйте результат, дату, владельца и оставшийся риск.
Продукты и затронутые версии
pnpm npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/exe npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/linux-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/linux-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/linuxstatic-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/macos-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/macos-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/win-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.33.4"
}@pnpm/cafs npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "7.0.5"
}pnpm npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/exe npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/linux-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/linux-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/linuxstatic-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/macos-arm64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/macos-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}@pnpm/win-x64 npm
{
"status": "affected",
"version": "*",
"versionEndExcluding": "8.6.8",
"versionStartIncluding": "8.0.0"
}CVSS: оценки и векторы
Оценка CVSS отсутствует.
Источники и ссылки
Происхождение полей
{
"cwes": [],
"epss": {
"source": "epss",
"received_at": "2026-11-03T21:06:18.019486+00:00"
},
"title": {
"source": "osv",
"received_at": "2026-11-02T12:13:41.139005+00:00"
},
"scores": [],
"affected": [
"osv"
],
"published": {
"source": "osv",
"received_at": "2026-11-02T12:13:41.139005+00:00"
},
"solutions": [],
"percentile": {
"source": "epss",
"received_at": "2026-11-03T21:06:18.019486+00:00"
},
"references": [
"osv"
],
"description": {
"source": "osv",
"received_at": "2026-11-02T12:13:41.139005+00:00"
},
"workarounds": [],
"configurations": []
}Хронология записи
- Данные обновлены04.11.2026, 00:06
- Данные обновлены03.11.2026, 00:06
- Опубликована02.11.2026, 15:13