Mixed npm and pnpm locks report an upgrade as applied without changing either lock

オープン
#1,691 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
node.js, typescript
領域
cli, security

調査の方向性

Start by reproducing with the linked fixture and the exact socket fix commands, then compare the apply result with git diff and a fresh dry-run. Trace how the CLI detects and updates package-lock.json and pnpm-lock.yaml when both are present; the issue names no source files or tests. Done means each lock is either changed and reported accurately, or the mixed-lock condition is reported without claiming unchanged files or unresolved targets were applied.

索引モデルが issue の本文から書いたものです。

説明

Mixed npm and pnpm locks report an upgrade as applied without changing either lock

Environment

  • Socket CLI 1.8.2, Coana CLI 15.12.11
  • Node.js 26.13.0, npm 11.20.0, pnpm 10.28.0
  • Linux container; lifecycle scripts disabled
  • Public dependencies only

Reproduction

Public fixture (manifest and both generated lockfiles): https://gist.github.com/ivan-novaprime/ae77a24cb98cc19e9afa0a0f9a108218

The accompanying fixture contains a package.json with [email protected], which depends on ip-address through ^10.2.0. Its npm-generated lock resolves [email protected] and its pnpm-generated lock resolves [email protected]. The files were generated with the respective package managers using historical release cutoffs; neither lock was edited by hand.

With Socket CLI authenticated by the normal supported method, from a fresh copy of the fixture:

npm ci --ignore-scripts --no-audit --no-fund
CI=true pnpm install --frozen-lockfile --ignore-scripts
git init
git add package.json package-lock.json pnpm-lock.yaml .gitignore
git -c user.name=Repro -c [email protected] commit -m baseline

socket fix --all --fix-version 15.12.11 --ecosystems npm \
  --no-major-updates --minimum-release-age 1w --range-style preserve \
  --no-apply-fixes --json --silence . > before.json

socket fix --id GHSA-h3mg-xc3c-68pw,GHSA-j6r3-76f7-8jcv,GHSA-rxp7-6hxx-x8q5 \
  --fix-version 15.12.11 --ecosystems npm --no-major-updates \
  --minimum-release-age 1w --range-style preserve --json --silence . > applied.json

git diff -- package.json package-lock.json pnpm-lock.yaml
socket fix --all --fix-version 15.12.11 --ecosystems npm \
  --no-major-updates --minimum-release-age 1w --range-style preserve \
  --no-apply-fixes --json --silence . > after.json

The targeted apply exits 1, so continue to the diff and rescan even when using a shell configured to exit on errors.

Observed

The initial plan proposes upgrading both locked versions to 10.7.4 for each of the three GHSAs. The apply result is ok: false and reports No file was changed for this upgrade for the 10.5.1 target under all three GHSAs. It also reports the 10.4.0 targets as applied and lists package-lock.json in modifiedFiles.

However, git diff is empty: the npm lock still resolves 10.5.1 and the pnpm lock still resolves 10.4.0. A fresh dry-run still proposes both versions. Thus the reported applied target and modified-file list do not match the actual fixture diff.

For comparison, separate fixtures with the same manifest and only the npm lock or only the pnpm lock both apply the three targeted upgrades successfully, changing the corresponding lock to 10.7.4; the targeted GHSAs are absent from each fresh rescan.

Expected

Each supported lockfile should either be upgraded and reported accurately, or the result should identify the unsupported mixed-lock condition without reporting unchanged files or unresolved targets as applied.

主要言語
TypeScript
スター
335
フォーク
74
平均マージ
1日 11時間
マージ済み PR(30日)
91

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

SocketDev/socket-cli のほかの issue

SocketDev/socket-cli の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。