Skip to content

fix(self-update): support registries without canonical tarball URLs or signature metadata - #13728

Merged
zkochan merged 8 commits into
mainfrom
self-install-fixes
Aug 8, 2026
Merged

zkochan merged 8 commits into
mainfrom
self-install-fixes

Conversation

@zkochan

@zkochan zkochan commented Aug 8, 2026 •

Copy link
Copy Markdown
Member

Summary

Unblocks the automatic packageManager version switch (and pnpm self-update) behind private mirrors and feed proxies, while keeping the bootstrap-hardening guarantees of #12296 and #12292 intact. This is the pair of regressions reported by Microsoft in discussion 3787, which currently blocks >200 monorepos / >4k engineers there.

Closes #13619. Closes #13147.

What changes (both stacks):

  1. Integrity-only package-manager entries — registries that advertise tarballs on another host (load-balanced proxies, Artifactory-style mirrors) always retained a tarball URL in the resolution, which the strict env-lockfile validation then rejected. The advertised URL is now dropped at resolution time: the bootstrap never fetches a lockfile-recorded URL anyway (the URL is always derived from the trusted bootstrap registries), so the entries land in exactly the integrity-only shape the validation accepts. The validation itself is unchanged — still maximally strict.
  2. Self-healing — entries persisted in an invalid shape by an earlier pnpm (including 11.5.3+, which wrote tarball-carrying entries before rejecting them) are discarded and re-resolved through the trusted registries instead of failing every command.
  3. Canonical-registry signature fallback — when the configured registry serves no dist.signatures (or only a stale/broken one), the signature is fetched from registry.npmjs.org and verified against the same embedded npm keys over the installed integrity. Where the signature bytes come from does not change what they prove, so this is exactly as strong as today's check, and it also rides out mirrors caching signatures from rotated-out keys.
  4. Warn-and-proceed only when no signature is obtainable — if both sources are unreachable, or the registry publishes only a shasum (a sha1 pin no npm signature can ever cover — Microsoft's proxy does both), the switch proceeds with a warning only when the engine resolves through a non-canonical registry, which can only come from the user's own trusted (non-project) configuration. The canonical-registry comparison normalizes through URL parsing, so URL-equivalent spellings (https://Registry.NPMJS.org:443/) cannot sidestep the fail-closed policy.

Why this stays secure (the properties #12296 / #12292 established):

  • A cloned repository still cannot steer the bootstrap download: URLs never come from the lockfile, registries and network config never come from project config.
  • Repo-controlled lockfile integrity can only pin bytes — a mismatch fails the download; it can never select attacker bytes.
  • Tamper evidence always fails closed: a signature that exists but does not validate over the installed integrity hard-fails, as does a reachable canonical registry answering that no signed release exists.
  • The residual trust in the warn path equals the trust the user already places in their own configured registry for every package they install from it — the same posture corepack takes for custom registries (its integrity check applies to the default registry).

Verified end to end against the registry from the report (packagefeedproxy.microsoft.io, publicly readable): both the legacy packageManager path and the persisting devEngines path now switch successfully, and the persisted entries are integrity-only.

Notes / known gaps:

  • On the automatic-switch path the "proceeding unverified" warning is currently emitted before the reporter subscribes (TS) / through SilentReporter (pacquet), so it is not visible there; it is visible on pnpm self-update and pnpm with. This mirrors the pre-existing handling of other bootstrap-time warnings in both stacks and could be improved in a follow-up.
  • pacquet's engine GVS slot cache is unaffected by the resolution-shape change (the slot hash is derived from the integrity alone when one is present).

Squash Commit Body

The package-manager bootstrap hardening broke version switching on
private mirrors and feed proxies:

1. Registries that advertise tarballs on a different host than the one
   serving the packument always retain a tarball URL in the resolution,
   which the integrity-only env-lockfile validation then rejects
   (Closes pnpm/pnpm#13619).
2. Registries that serve no dist.signatures fail the engine identity
   check outright (Closes pnpm/pnpm#13147).

Fixes, in both stacks:

- Package-manager dependency resolutions are recorded integrity-only:
  the advertised tarball URL is dropped at resolution time, because the
  bootstrap never fetches a lockfile-recorded URL - the download URL is
  always derived from the trusted bootstrap registries. Dropping the URL
  does not perturb the global-virtual-store slot hash, which is derived
  from the integrity alone whenever one is present.
- Persisted entries that fail the bootstrap validation (e.g. written by
  an earlier pnpm) are discarded and re-resolved through the trusted
  registries instead of failing every command.
- Engine identity verification falls back to fetching the signature from
  the canonical npm registry when the configured registry cannot provide
  a verifiable one; it is verified against the same embedded npm keys
  over the installed integrity, so the source of the signature bytes
  does not change what they prove.
- When no signature is obtainable at all (both sources unreachable, or a
  shasum-only registry yields a sha1 pin no npm signature can cover),
  the switch proceeds with a warning - only when the engine resolves
  through a non-canonical registry, which can only come from the user's
  own trusted (non-project) configuration. The canonical-registry
  comparison normalizes through URL parsing, so URL-equivalent spellings
  cannot sidestep the fail-closed policy. Tamper evidence still fails
  closed.

Verified end to end against packagefeedproxy.microsoft.io, the registry
from the report in discussion 3787.

Checklist

  • I checked the referenced issue and verified that none of the PRs
    already linked to it solves it.
  • The change is implemented in both the TypeScript CLI and the Rust
    pnpm/ port.
  • Added a changeset (pnpm changeset) if this PR changes any published
    package. Keep it short and written for pnpm users — it becomes a release note.
  • Added or updated tests.

Written by an agent (Claude Code, claude-fable-5).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • New Features

    • Improved automatic package-manager version switching across registries with different download hosts.
    • Registry tarball references can now be stored as integrity-only resolutions.
    • Added fallback signature verification through the canonical npm registry when configured registries lack signature metadata.
  • Bug Fixes

    • Invalid or outdated package-manager lockfile entries are automatically re-resolved and repaired.
    • Invalid signatures still fail verification, while unavailable or unsigned mirror metadata produces a warning.
    • Improved handling of unsupported integrity formats and registry URL differences.

zkochan and others added 2 commits August 8, 2026 12:13
…r signature metadata

The package-manager bootstrap hardening (#12296, #12292)
broke version switching on private mirrors and feed proxies:

1. Registries that advertise tarballs on a different host than the one
   serving the packument (load-balanced proxies, Artifactory-style
   mirrors) always retain a tarball URL in the resolution, which the
   integrity-only env-lockfile validation then rejects
   (Closes #13619).
2. Registries that serve no dist.signatures fail the engine identity
   check outright (Closes #13147).

Fixes, in both stacks:

- Package-manager dependency resolutions are now recorded integrity-only:
  the advertised tarball URL is dropped at resolution time, because the
  bootstrap never fetches a lockfile-recorded URL anyway - the download
  URL is always derived from the trusted bootstrap registries. This keeps
  freshly resolved entries in exactly the shape the strict validation
  accepts, without weakening the validation itself. Dropping the URL does
  not perturb the global-virtual-store slot hash, which is derived from
  the integrity alone whenever one is present.
- Persisted entries that fail the validation (e.g. tarball-carrying
  resolutions written by an earlier pnpm - including 11.5.3+, which
  wrote them before rejecting them) are discarded and re-resolved through
  the trusted bootstrap registries instead of failing every command.
- Engine identity verification now falls back to fetching the signature
  from the canonical npm registry when the configured registry cannot
  provide a verifiable one. The signature is verified against the same
  embedded npm keys over the installed integrity, so where the signature
  bytes come from does not change what they prove; this also rides out a
  mirror serving stale signatures from a rotated-out key.
- When no signature is obtainable at all (both sources unreachable, or
  the registry publishes only a shasum, so the sha1 pin can never be
  covered by an npm signature), the switch proceeds with a warning - but
  only when the engine resolves through a non-canonical registry, which
  can only come from the user's own trusted (non-project) configuration.
  A signature that exists but does not validate still hard-fails, as does
  a reachable canonical registry answering that no signed release exists.

Security invariants preserved: a cloned repository still cannot steer the
bootstrap fetch (URLs never come from the lockfile; registries never come
from project config), repo-controlled integrity can only pin bytes (a
mismatch fails the download), and tamper evidence always fails closed.
The residual trust in the warn-and-proceed path equals the trust the user
already places in their own configured registry for every package they
install from it, matching corepack's handling of custom registries.

Verified end to end against packagefeedproxy.microsoft.io, the registry
from the report in the discussion (pnpm/orgs discussion 3787): the
version switch now succeeds on both the legacy packageManager path and
the persisting devEngines path.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 8, 2026 10:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Package-manager switching now repairs invalid persisted resolutions and converts mirror tarballs to integrity-only records. Signature verification can use the canonical npm registry when configured registries lack metadata. Invalid signatures and unsafe canonical-registry failures remain errors.

Changes

Package-manager bootstrap

Layer / File(s) Summary
Bootstrap resolution and forced synchronization
pnpm/crates/env-installer/..., pnpm/crates/cli/src/config_deps.rs, pnpm/crates/cli/src/cli_args/...
Package-manager synchronization accepts force_resync. Eligible non-derivable tarball URLs become integrity-only registry resolutions.
Bootstrap validation and regression coverage
pnpm/crates/cli/src/cli_args/pre_command.rs, pnpm/crates/env-installer/src/tests.rs, pnpm11/pnpm/src/switchCliVersion.*
Invalid persisted resolutions are discarded and resolved again. Tests cover mirror tarballs, invalid paths, and unresolved refreshed entries.
Installer tarball normalization
pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts, pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts
Registry tarball URLs are removed from package-manager resolutions. Local, Git-hosted, and path-based resolutions retain their metadata.

Signature fallback verification

Layer / File(s) Summary
Fallback signature verification
pnpm11/deps/security/signatures/..., pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs
Verification records source registries, rejects unsupported integrity algorithms, and retries missing signature metadata through an optional fallback registry.
Engine verification warnings and validation
pnpm11/engine/pm/commands/..., pnpm/crates/cli/src/cli_args/self_update.rs, pnpm/crates/cli/src/cli_args/with/install_pnpm_to_store.rs
Canonical npm fallback verification warns for tolerable non-canonical failures and continues to reject invalid signatures and canonical-registry failures.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant BootstrapResolver
  participant ConfiguredRegistry
  participant SignatureVerifier
  participant CanonicalNpmRegistry
  CLI->>BootstrapResolver: resolve packageManager version
  BootstrapResolver->>ConfiguredRegistry: fetch package metadata
  ConfiguredRegistry-->>BootstrapResolver: tarball and integrity
  BootstrapResolver-->>CLI: integrity-only bootstrap resolution
  CLI->>SignatureVerifier: verify installed engine
  SignatureVerifier->>ConfiguredRegistry: request signatures
  ConfiguredRegistry-->>SignatureVerifier: signature metadata or missing metadata
  SignatureVerifier->>CanonicalNpmRegistry: request fallback metadata
  CanonicalNpmRegistry-->>SignatureVerifier: fallback signature result
Loading

Assessment against linked issues

Objective Addressed Explanation
Support package-manager switching when registry tarballs use a different host [#13619] ✅
Allow registries without signature metadata while rejecting invalid signatures [#13147] ✅

Possibly related PRs

  • pnpm/pnpm#13287: Shares package-manager switching and synchronization code paths.
  • pnpm/pnpm#13382: Overlaps in package-manager dependency synchronization and switch planning.
  • pnpm/pnpm#13599: Modifies package-manager integrity resolution and engine identity verification.

Suggested labels: product: pacquet, product: pnpm@11

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch self-install-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix self-update on mirrors lacking canonical tarball URLs or npm signatures

🐞 Bug fix 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Record package-manager env-lockfile entries as integrity-only, dropping non-derivable tarball
 URLs.
• Self-heal previously persisted invalid packageManagerDependencies by forcing trusted
 re-resolution.
• Add canonical-registry signature fallback and warn-only mode when signatures are unobtainable.
Diagram

graph TD
  A["CLI switch/self-update"] --> B["config_deps sync"] --> C["Env-installer resolve"] --> D[("Env lockfile")]
  D --> E["Signature verify"] --> F{{"User registry"}}
  E --> G{{"registry.npmjs.org"}}

  subgraph Legend
    direction LR
    _cli["CLI"] ~~~ _mod["Module"] ~~~ _db[("Lockfile")] ~~~ _ext{{"Registry"}}
  end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Relax env-lockfile validation to allow tarball URLs
  • ➕ Avoids resolution-time rewriting and forced resync logic
  • ➕ May reduce surprise by preserving registry-advertised tarball metadata
  • ➖ Reintroduces risk of repository-controlled URL steering in future code paths
  • ➖ Diverges from the “integrity-only” hardening guarantees and increases review surface
2. Canonicalize tarball URLs instead of dropping them
  • ➕ Retains a tarball field for debugging/telemetry while aiming for stable URLs
  • ➕ Could preserve more metadata for tooling
  • ➖ Requires robust canonicalization across registry implementations and mirrors
  • ➖ Still encourages consumers to rely on lockfile-recorded URLs, which the bootstrap explicitly avoids
3. Require signatures to be present on the configured registry only
  • ➕ Simpler rule; fewer network calls
  • ➕ Clear security stance: fail closed always
  • ➖ Breaks private mirrors/proxies that strip dist.signatures (real-world common)
  • ➖ Does not improve security vs verifying the same signature over the same integrity from a canonical source

Recommendation: The PR’s approach is the best balance: keep strict integrity-only bootstrap rules (no URL steering), but make resolution and verification resilient to real-world mirrors. Dropping non-derivable tarball URLs at resolution time aligns stored data with what the bootstrap actually uses. The canonical-registry signature fallback preserves the same cryptographic proof over installed integrity, and the warn-and-proceed path is narrowly scoped to user-configured non-canonical registries and only when signatures are unobtainable (not invalid), maintaining fail-closed behavior for tamper evidence.

Files changed (20) +1081 / -187

Enhancement (1) +84 / -7
verifySignatures.tsAdd fallback registry verification and 'uncovered' failure category +84/-7

Add fallback registry verification and 'uncovered' failure category

• Enhances installed signature verification to optionally consult a fallback registry for dist.signatures and to short-circuit with an 'uncovered' category when integrity is not sha512. Includes registry provenance in failure objects and avoids consulting fallback when it is the same registry.

pnpm11/deps/security/signatures/src/verifySignatures.ts

Bug fix (11) +444 / -100
pipelines.rsThread new force_resync flag through CLI pipelines +7/-0

Thread new force_resync flag through CLI pipelines

• Updates pipeline calls that sync package-manager dependencies to pass an additional boolean parameter. This enables later healing behavior without altering unrelated pipeline logic.

pnpm/crates/cli/src/cli_args/pipelines.rs

pre_command.rsSelf-heal invalid env lockfile entries during packageManager switching +45/-6

Self-heal invalid env lockfile entries during packageManager switching

• Extends switch planning/execution to detect invalid packageManagerDependencies and force re-resolution through trusted registries. Introduces a force_resync flag in SwitchSource and triggers a sync even when no version switch is needed.

pnpm/crates/cli/src/cli_args/pre_command.rs

self_update.rsEmit warning when engine identity verification is non-fatal +7/-1

Emit warning when engine identity verification is non-fatal

• Updates self-update to handle a warning-returning engine identity verification API. Warnings are logged, while hard failures still abort the self-update.

pnpm/crates/cli/src/cli_args/self_update.rs

verify_engine.rsAdd canonical npm registry fallback and tolerable failure categories +186/-63

Add canonical npm registry fallback and tolerable failure categories

• Implements signature metadata fallback to the canonical npm registry when configured registries omit or provide unusable dist.signatures. Introduces an 'Uncovered' category for non-sha512 integrities and allows warn-only continuation when signatures are unobtainable from non-canonical user registries; invalid signatures still fail closed.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs

with.rsPass force_resync through 'pnpm with' store installation path +1/-0

Pass force_resync through 'pnpm with' store installation path

• Updates the 'with' command plumbing to pass the new force_resync parameter when installing pnpm into the store.

pnpm/crates/cli/src/cli_args/with.rs

install_pnpm_to_store.rsSupport forced env-lockfile resync and warning-based engine verification +23/-5

Support forced env-lockfile resync and warning-based engine verification

• Adds a force_resync parameter to env lockfile syncing, ensuring invalid-but-up-to-date entries can be rewritten. Updates engine identity verification handling to emit warnings when verification is not possible under approved conditions.

pnpm/crates/cli/src/cli_args/with/install_pnpm_to_store.rs

config_deps.rsPlumb force_resync into package-manager dependency syncing +13/-5

Plumb force_resync into package-manager dependency syncing

• Extends sync_package_manager_dependencies to accept a force_resync flag and pass it through to env-installer resolution. Keeps frozen-lockfile semantics intact while enabling healing behavior.

pnpm/crates/cli/src/config_deps.rs

resolve_package_manager_integrities.rsStrip registry tarball URLs and add forced-resync support +41/-12

Strip registry tarball URLs and add forced-resync support

• Adds a force_resync fast-path bypass so recorded entries can be discarded and re-resolved. Normalizes package-manager package resolutions by rewriting tarball+integrity entries into integrity-only registry resolutions (dropping non-file tarball URLs).

pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs

verifyPnpmEngineIdentity.tsUse canonical npm registry as signature fallback and warn on tolerable failures +50/-7

Use canonical npm registry as signature fallback and warn on tolerable failures

• Calls signature verification with fallbackRegistry set to https://registry.npmjs.org/ and adds a warn-and-proceed path when all failures are tolerable (unreachable/uncovered from non-canonical registries). Preserves fail-closed behavior for invalid signatures and canonical-registry absence/unreachability.

pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts

resolvePackageManagerIntegrities.tsStrip registry tarball URLs from resolved lockfiles in pnpm11 installer +29/-0

Strip registry tarball URLs from resolved lockfiles in pnpm11 installer

• Adds a post-resolution rewrite that drops tarball URLs while preserving integrity for package-manager packages. Ensures env-lockfile entries match the integrity-only shape required by bootstrap validation.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts

switchCliVersion.tsSelf-heal invalid package-manager env lockfiles before switching versions +42/-1

Self-heal invalid package-manager env lockfiles before switching versions

• Detects invalid package-manager env lockfile entries (ERR_PNPM_INVALID_PACKAGE_MANAGER_LOCKFILE) and, when not freshly resolved, discards packageManagerDependencies and re-resolves via trusted registries. Ensures a second validation pass succeeds (or errors if still invalid) before executing the switch.

pnpm11/pnpm/src/switchCliVersion.ts

Tests (6) +538 / -80
tests.rsAdjust switch_target tests to expect discard-and-reresolve behavior +14/-15

Adjust switch_target tests to expect discard-and-reresolve behavior

• Renames tests from rejecting invalid lockfile entries to discarding them. Asserts the switch target becomes a forced Resolve path instead of throwing an error.

pnpm/crates/cli/src/cli_args/pre_command/tests.rs

tests.rsAdd unit tests for signature fallback, tamper detection, and uncovered integrities +159/-2

Add unit tests for signature fallback, tamper detection, and uncovered integrities

• Adds tests verifying fallback success when mirrors provide no/unusable signatures, invalid signature detection over tampered integrity, unreachable fallback categorization, and early uncovered handling for non-sha512 integrity pins.

pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs

tests.rsTest integrity-only recording and forced-resync overwrite behavior +118/-5

Test integrity-only recording and forced-resync overwrite behavior

• Extends the fixture resolver to simulate non-derivable tarball URLs and adds tests asserting integrity-only lockfile resolutions. Adds a test verifying that force_resync overwrites previously recorded invalid entries.

pnpm/crates/env-installer/src/tests.rs

verifySignatures.tsAdd tests for fallback verification, unreachable fallback, and uncovered integrity +92/-2

Add tests for fallback verification, unreachable fallback, and uncovered integrity

• Adds test cases covering fallback success, tampered integrity detection, unreachable/absent fallback behaviors, no-op fallback when identical to primary, and uncovered handling for sha1 integrity pins.

pnpm11/deps/security/signatures/test/verifySignatures.ts

verifyPnpmEngineIdentity.test.tsTest canonical fallback and warn-only behavior in pnpm11 engine verification +65/-9

Test canonical fallback and warn-only behavior in pnpm11 engine verification

• Updates tests to require absence across both configured and canonical registries for the 'absent' scenario. Adds new cases for warning/proceed on unreachable user registries, fallback verification success, tampered integrity rejection, uncovered handling, and canonical-registry strictness.

pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts

switchCliVersion.test.tsUpdate switchCliVersion tests for discard-and-reresolve healing +90/-47

Update switchCliVersion tests for discard-and-reresolve healing

• Changes expectations from hard rejection of invalid package-manager lockfiles to discarding invalid entries and re-resolving through trusted registries. Adds coverage for still-invalid-after-reresolve behavior.

pnpm11/pnpm/src/switchCliVersion.test.ts

Documentation (2) +15 / -0
pm-bootstrap-nonderivable-tarball-registries.mdDocument integrity-only env-lockfile entries for mirror tarball URLs +7/-0

Document integrity-only env-lockfile entries for mirror tarball URLs

• Adds a changeset describing the fix for registries that advertise tarballs on different hosts. Explains that package-manager entries are now stored as integrity-only and invalid persisted entries are self-healed.

.changeset/pm-bootstrap-nonderivable-tarball-registries.md

pm-signature-fallback-registry.mdDocument canonical-registry signature fallback and warning behavior +8/-0

Document canonical-registry signature fallback and warning behavior

• Adds a changeset describing signature verification fallback to registry.npmjs.org when mirrors omit dist.signatures. Documents warn-and-proceed behavior when signatures are unobtainable from non-canonical (user) registries.

.changeset/pm-signature-fallback-registry.md

@greptile-apps

greptile-apps Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Reviews (6): Last reviewed commit: "fix(deps.security.signatures): sanitize ..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
pnpm/crates/cli/src/cli_args/self_update.rs (1)

281-288: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Repair invalid persisted resolutions before self-update.

Line 287 passes false, so a matching recorded closure takes the fast path and retains old tarball resolutions. switch_target treats that shape as invalid and forces replacement at Lines 579-593 of pnpm/crates/cli/src/cli_args/pre_command.rs.

When a global environment has a persisted invalid closure for the requested version, self-update does not perform the recovery described by this PR. Reuse the bootstrap-resolution validation before this call and force synchronization only when that validation fails. Add a regression test with a persisted tarball resolution and an already-recorded self-update target.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/src/cli_args/self_update.rs` around lines 281 - 288, Validate
the persisted bootstrap resolution before the self-update call in the relevant
self-update flow, using the same invalid-closure criteria as switch_target. Pass
the resulting force-sync decision instead of the hardcoded false to
config_deps::sync_package_manager_dependencies, so invalid tarball resolutions
are replaced while valid closures retain the fast path. Add a regression test
covering a persisted tarball resolution with an already-recorded self-update
target.
🧹 Nitpick comments (2)
pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs (1)

208-298: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add coverage for the equal-registry short-circuit.

find_signature_failure skips the fallback when equal_registries(&component.registry, fallback_registry) is true. No test in this file exercises that branch. The TypeScript suite covers it ("does not consult the fallback when it is the package registry itself" in pnpm11/deps/security/signatures/test/verifySignatures.ts). Add the matching Rust test to keep both suites aligned.

🧪 Proposed test
#[tokio::test]
async fn does_not_consult_the_fallback_when_it_is_the_component_registry() {
    let mut mirror = mockito::Server::new_async().await;
    let component = EngineComponent { registry: format!("{}/", mirror.url()), ..component() };
    // `expect(1)` fails the mock assertion if a second request arrives.
    let mirror_mock = mirror
        .mock("GET", "/pnpm")
        .with_status(200)
        .with_body(packument_body("pnpm", "12.0.0", "[]"))
        .expect(1)
        .create_async()
        .await;

    let failure = find_failure_with_fallback(&component, &mirror.url())
        .await
        .expect("failure expected");
    assert!(matches!(failure.category, FailureCategory::Absent));
    mirror_mock.assert_async().await;
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs` around lines
208 - 298, Add a Tokio test alongside the existing fallback tests covering
find_signature_failure when fallback_registry equals component.registry. Mock
the component registry’s single packument request with an expectation of exactly
one call and no signatures, invoke find_failure_with_fallback using the same
registry URL, assert an Absent failure, and verify the mock so any fallback
request fails the test.
pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts (1)

71-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the warning, not only the resolution.

Both tests are named "warns and proceeds", but they assert only that the promise resolves. The warning emitted through globalWarn is the new user-visible behavior of this change. A regression that drops the globalWarn call would keep both tests green. Spy on the logger and assert the message.

🧪 Proposed assertion
+import { globalWarn } from '`@pnpm/logger`'
+
+jest.mock('`@pnpm/logger`', () => ({
+  ...jest.requireActual('`@pnpm/logger`'),
+  globalWarn: jest.fn(),
+}))
   test('warns and proceeds when a user-configured registry is unreachable and no signature is obtainable', async () => {
     await expect(verifyPnpmEngineIdentity(envLockfile(), '9.1.0', optsTrusting(createSigningKey()))).resolves.toBeUndefined()
+    expect(globalWarn).toHaveBeenCalledWith(expect.stringContaining('could not be verified'))
   })

Also applies to: 104-113

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts`
around lines 71 - 77, Update the “warns and proceeds” tests around
verifyPnpmEngineIdentity to spy on globalWarn and assert it is called with the
expected warning message, while retaining the existing resolution assertions.
Apply the same verification to both affected test cases.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts`:
- Around line 135-138: Update isTolerableWithoutSignature to use the shared
equalRegistries helper instead of regex-based, case-sensitive trailing-slash
comparisons. Export equalRegistries from verifySignatures.ts and import it from
`@pnpm/deps.security.signatures`, preserving the existing unreachable/uncovered
condition while ensuring canonical registry matching is case-insensitive and
normalized consistently.

In `@pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts`:
- Around line 118-144: Add focused TypeScript regression tests in
resolvePackageManagerIntegrities.test.ts for stripRegistryTarballUrls via
resolvePackageManagerIntegrities: verify mirror-hosted registry tarballs persist
only a non-empty integrity, while file: tarballs, gitHosted resolutions, and
path resolutions retain their existing shape. Keep pnpm and pacquet behavior
unchanged and add the required accurate changeset.

---

Outside diff comments:
In `@pnpm/crates/cli/src/cli_args/self_update.rs`:
- Around line 281-288: Validate the persisted bootstrap resolution before the
self-update call in the relevant self-update flow, using the same
invalid-closure criteria as switch_target. Pass the resulting force-sync
decision instead of the hardcoded false to
config_deps::sync_package_manager_dependencies, so invalid tarball resolutions
are replaced while valid closures retain the fast path. Add a regression test
covering a persisted tarball resolution with an already-recorded self-update
target.

---

Nitpick comments:
In `@pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs`:
- Around line 208-298: Add a Tokio test alongside the existing fallback tests
covering find_signature_failure when fallback_registry equals
component.registry. Mock the component registry’s single packument request with
an expectation of exactly one call and no signatures, invoke
find_failure_with_fallback using the same registry URL, assert an Absent
failure, and verify the mock so any fallback request fails the test.

In
`@pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts`:
- Around line 71-77: Update the “warns and proceeds” tests around
verifyPnpmEngineIdentity to spy on globalWarn and assert it is called with the
expected warning message, while retaining the existing resolution assertions.
Apply the same verification to both affected test cases.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: aec457fc-da19-4c07-bb7b-3bffe23edcd5

📥 Commits

Reviewing files that changed from the base of the PR and between 6b6205b and bdc4465.

📒 Files selected for processing (20)
  • .changeset/pm-bootstrap-nonderivable-tarball-registries.md
  • .changeset/pm-signature-fallback-registry.md
  • pnpm/crates/cli/src/cli_args/pipelines.rs
  • pnpm/crates/cli/src/cli_args/pre_command.rs
  • pnpm/crates/cli/src/cli_args/pre_command/tests.rs
  • pnpm/crates/cli/src/cli_args/self_update.rs
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs
  • pnpm/crates/cli/src/cli_args/with.rs
  • pnpm/crates/cli/src/cli_args/with/install_pnpm_to_store.rs
  • pnpm/crates/cli/src/config_deps.rs
  • pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs
  • pnpm/crates/env-installer/src/tests.rs
  • pnpm11/deps/security/signatures/src/verifySignatures.ts
  • pnpm11/deps/security/signatures/test/verifySignatures.ts
  • pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts
  • pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts
  • pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts
  • pnpm11/pnpm/src/switchCliVersion.test.ts
  • pnpm11/pnpm/src/switchCliVersion.ts

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Micro-Benchmark Results

Linux

group                                            main                                   pr
-----                                            ----                                   --
lockfile/parse_pnpm_lock                         1.01     10.7±0.18ms    35.0 MB/sec    1.00     10.6±0.20ms    35.3 MB/sec
packument/parse                                  1.00     35.7±0.58µs  1857.1 MB/sec    1.01     36.2±0.60µs  1834.5 MB/sec
tarball/download_dependency                      1.00      2.9±0.09ms  1508.0 KB/sec    1.02      2.9±0.14ms  1484.8 KB/sec
tarball_batch/cold_store_many_medium_tarballs    1.00    162.3±0.83ms 98.6 KElem/sec    1.01    163.4±1.31ms 97.9 KElem/sec
workspace_resolution/hoist_heavy                 1.00    222.4±2.44ms        ? ?/sec    1.00    221.9±1.76ms        ? ?/sec

@codecov-commenter

codecov-commenter commented Aug 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.52830% with 54 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.23%. Comparing base (6b6205b) to head (09333a6).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ates/cli/src/cli_args/self_update/verify_engine.rs 80.48% 24 Missing ⚠️
pnpm/crates/cli/src/cli_args/pre_command.rs 56.00% 11 Missing ⚠️
pnpm/crates/cli/src/cli_args/self_update.rs 0.00% 7 Missing ⚠️
pnpm/crates/cli/src/cli_args/pipelines.rs 14.28% 6 Missing ⚠️
...tes/cli/src/cli_args/with/install_pnpm_to_store.rs 68.42% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main   #13728    +/-   ##
========================================
  Coverage   88.22%   88.23%            
========================================
  Files         616      616            
  Lines      100163   100306   +143     
========================================
+ Hits        88373    88505   +132     
- Misses      11790    11801    +11     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@qodo-code-review

qodo-code-review Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Control-char canonicality bypass ✓ Resolved 🐞 Bug ⛨ Security ⭐ New
Description
Signature verification and self-update verification in both TypeScript and Rust use
redactUrlCredentials/redact_url_credentials (instead of the existing
redactAndSanitize/redact_and_sanitize) when persisting/printing registries, building failure
reasons, and normalizing registries for equalRegistries/equal_registries. Because the credential
redaction stops scanning userinfo at whitespace/CRLF and does not strip control characters, a
registry like https://user:******@registry.npmjs.org/ can leak credentials into warnings/errors,
enable log/terminal injection via control characters, and cause canonical-registry comparisons to
fail—incorrectly allowing warn-and-proceed for Unreachable/Uncovered self-update failures.
Code

pnpm11/deps/security/signatures/src/verifySignatures.ts[R607-613]

+  const withSlash = redactUrlCredentials(registry.endsWith('/') ? registry : `${registry}/`)
+  try {
+    // URL normalization lowercases the host and drops a default port.
+    return new url.URL(withSlash).toString().toLowerCase()
+  } catch {
+    return withSlash.toLowerCase()
+  }
Relevance

●●● Strong

Close precedent: team accepted sanitizing control chars before credential redaction to prevent \r/@
bypass and log injection.

PR-#13230

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In verifySignatures.ts, registry normalization and error/failure-reason construction use
redactUrlCredentials, even though redactAndSanitize exists specifically to make URL-bearing text
safe for logs by stripping control characters before redacting; the self-updater then emits these
failure reasons through globalWarn without additional sanitization, and the current tests only
exercise plain user:pass@ cases (not CR/LF or other control characters). On the Rust side,
verify_engine.rs similarly stores/formats registries and normalizes them via
redact_url_credentials/normalize_registry_url, where the underlying behavior stops userinfo
scanning at whitespace and does not remove control characters; the repository already provides
redact_and_sanitize to address this exact bypass pattern, so the cited usage directly explains how
credentials and control characters can survive into output and why equal_registries can
misclassify the canonical npm registry as non-canonical.

pnpm11/deps/security/signatures/src/verifySignatures.ts[556-564]
pnpm11/deps/security/signatures/src/verifySignatures.ts[541-544]
pnpm11/deps/security/signatures/src/verifySignatures.ts[602-613]
pnpm11/deps/security/signatures/src/verifySignatures.ts[487-490]
pnpm11/core/error/src/index.ts[78-123]
pnpm11/core/logger/src/logger.ts[15-19]
pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[112-116]
pnpm11/deps/security/signatures/test/verifySignatures.ts[417-429]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[341-347]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[401-406]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[424-432]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[494-502]
pnpm/crates/network/src/auth.rs[762-800]
PR-#13230

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
TypeScript (`verifySignatures.ts`) and Rust (`verify_engine.rs`) registry handling for signature/self-update verification uses `redactUrlCredentials`/`redact_url_credentials` in places where strings are persisted on failures, printed in warnings/errors, and normalized for canonical-registry comparisons (`equalRegistries`/`equal_registries`). These redaction helpers do **not** strip control characters and stop userinfo scanning at ASCII whitespace/CRLF, so crafted registries like `https://user:******@registry.npmjs.org/` can bypass credential redaction, leak secrets into warnings/errors, introduce log/terminal injection via control characters, and break URL parsing/normalization such that canonical registries compare non-equal—incorrectly enabling warn-and-proceed behavior for `Unreachable`/`Uncovered` failures.

## Issue Context
The codebase already includes safer helpers (`redactAndSanitize` in TS via `@pnpm/error`, and `redact_and_sanitize` in Rust) whose purpose is to strip control characters *before* performing URL credential redaction. Current TS tests validate that inline credentials are not echoed for simple `user:pass@` input but do not cover CR/LF/control-character bypasses, and warnings/errors are emitted (e.g., via `globalWarn`) without further sanitization.

## Fix Focus Areas
- pnpm11/deps/security/signatures/src/verifySignatures.ts[487-490]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[541-544]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[556-564]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[602-613]
- pnpm11/deps/security/signatures/test/verifySignatures.ts[417-429]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[341-347]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[401-406]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[424-426]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[499-502]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Registry userinfo mishandled ✓ Resolved 🐞 Bug ⛨ Security
Description
verifyInstalledPackageSignatures() now includes pkg.registry verbatim in
InstalledSignatureFailure, which can expose inline user:pass@ credentials and also makes
canonical-registry decisions treat URL userinfo as significant. As a result, a canonical npm
registry configured as https://user:[email protected]/ can be misclassified as non-canonical
and incorrectly allow the new warn-and-proceed path.
Code

pnpm11/deps/security/signatures/src/verifySignatures.ts[R483-486]

+    const failure = await findSignatureFailure(pkg, ctx)
    if (failure != null) {
-      failures.push({ name: pkg.name, version: pkg.version, ...failure })
+      failures.push({ name: pkg.name, version: pkg.version, registry: pkg.registry, ...failure })
    }
Relevance

●●● Strong

Team has recent accepted fixes to redact URL-embedded credentials in errors/output; same leakage
risk here.

PR-#12519
PR-#13230
PR-#12786

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code now pushes pkg.registry into the returned failures list without sanitization, and
canonicality decisions in the engine verifier rely on equalRegistries() which normalizes URLs but
does not strip userinfo. The pnpm11 error utilities explicitly document that registries can carry
inline user:pass@ credentials and that these must be redacted to prevent leakage.

pnpm11/deps/security/signatures/src/verifySignatures.ts[473-486]
pnpm11/deps/security/signatures/src/verifySignatures.ts[592-603]
pnpm11/core/error/src/index.ts[65-71]
pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[112-139]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`InstalledSignatureFailure.registry` is populated with the raw `pkg.registry` string. Registry URLs may legally contain inline basic-auth userinfo (`https://user:pass@host/`), which should never appear in returned/serializable structures.

Additionally, registry canonicality checks should treat URL userinfo as irrelevant. Keeping it in the normalized form causes `https://user:[email protected]/` to compare unequal to the canonical `https://registry.npmjs.org/`, weakening fail-closed decisions keyed on “is this canonical?”.

### Issue Context
- The repo already documents that registries can contain inline credentials and that they must be redacted/sanitized before they reach user-visible output.
- `verifyPnpmEngineIdentity()` uses `equalRegistries(failure.registry, CANONICAL_NPM_REGISTRY)` to decide whether an unverifiable signature can be tolerated; if `failure.registry` retains userinfo, the canonical registry can be incorrectly treated as “non-canonical”.

### Fix Focus Areas
- pnpm11/deps/security/signatures/src/verifySignatures.ts[483-486]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[592-603]

### What to change
1. Introduce a small helper to sanitize registry URLs for both comparison and reporting:
  - Parse with `new URL(...)` when possible.
  - Clear `url.username` and `url.password`.
  - Preserve existing normalization behavior (trailing slash, default-port elision, host case-insensitivity).
  - On parse failure, fall back to string processing that at minimum strips `user:pass@` after a scheme (or reuse an existing helper if available in the pnpm11 TS stack).
2. Use the sanitized form:
  - In `equalRegistries()` / `normalizeRegistryUrl()` (so comparisons ignore userinfo).
  - When populating `InstalledSignatureFailure.registry` (so returned results cannot contain credentials).
3. Add a regression test (in the relevant consumer tests) asserting that a canonical registry with inline userinfo is still recognized as canonical for fail-closed decisions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. Canonical registry misdetected ✓ Resolved 🐞 Bug ⛨ Security
Description
Registry canonicality checks in both the Rust self-update verifier and the TS signatures verifier
use overly simplistic URL normalization (case + trailing slash only), so URL-equivalent forms of the
canonical npm registry (e.g. with an explicit :443) can be misclassified as “non-canonical.” This
can incorrectly trigger the new warn-and-proceed path and allow self-update/engine identity
verification to continue without a verified signature when canonical npm should fail closed under
signature acquisition failures.
Code

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[R478-480]

+fn equal_registries(left: &str, right: &str) -> bool {
+    with_trailing_slash(left).eq_ignore_ascii_case(&with_trailing_slash(right))
}
Relevance

●●● Strong

Security-sensitive registry verification; repo has precedent hardening URL handling/normalization in
verifiers.

PR-#12491

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In Rust, tolerable_without_signature() depends on equal_registries() to decide whether the
configured registry is canonical, but equal_registries() only appends a trailing slash and
performs a case-insensitive string comparison, without URL parsing or normalization of default
ports/userinfo; likewise the PNPM_CONFIG_REGISTRY handling only appends a slash, so values like
https://registry.npmjs.org:443/ can persist into package_manager_bootstrap.registry and then
compare unequal to https://registry.npmjs.org/, enabling the non-canonical warn-and-proceed path.
In TS, the newly introduced local normalizeRegistryUrl() in the signatures verifier similarly does
not strip default ports, even though the repository already has (and tests) a URL-parsing-based
normalization helper that does, meaning canonical equality checks can fail for URL-equivalent
registry aliases such as https://registry.npmjs.org:443/.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[321-324]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[478-480]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[668-670]
pnpm/crates/config/src/lib.rs[2612-2617]
pnpm11/deps/security/signatures/src/verifySignatures.ts[577-583]
pnpm11/resolving/npm-resolver/src/normalizeRegistryUrl.ts[1-9]
pnpm11/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts[5-12]
pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[135-138]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Registry canonicality/equality decisions are currently based on simplistic string normalization (lowercasing + ensuring trailing slash), which fails for URL-equivalent canonical registry forms (notably explicit default ports like `:443`, and potentially userinfo). This can misclassify the canonical npm registry as “non-canonical,” incorrectly enabling the intended non-canonical-only warn-and-proceed behavior and allowing self-update / engine identity verification to proceed without a verified signature when canonical npm should fail closed if signatures are unobtainable.

## Issue Context
The change set intentionally allows “warn and proceed” only for *non-canonical* registries under the assumption the user explicitly trusts their custom registry; canonical npm is meant to remain a strict trust boundary where signature acquisition/verification failures should not be tolerated. However, Rust’s `equal_registries()` and config parsing, and TS’s new local `normalizeRegistryUrl()` (used for registry equality decisions), do not normalize URL-equivalent values (e.g. stripping default ports) even though the repo already contains a URL-parsing-based normalization utility (with tests) that does.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[321-324]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[478-480]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[668-670]
- pnpm/crates/config/src/lib.rs[2612-2617]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[577-583]
- pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[135-138]
- pnpm11/resolving/npm-resolver/src/normalizeRegistryUrl.ts[1-9]
- pnpm11/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts[5-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

4. Git-host URL mis-stripped 🐞 Bug ≡ Correctness
Description
The new test only asserts preserving git-hosted tarballs when gitHosted: true is present, but
elsewhere the codebase treats git-hosted tarball URLs as git-hosted even without this flag. This
leaves a compatibility case untested (and currently mishandled by stripRegistryTarballUrls), where
a git-host tarball URL without gitHosted could be rewritten into an integrity-only resolution.
Code

pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[R90-93]

+  expect(resolutionOf('[email protected]')).toEqual({
+    integrity: 'sha512-git',
+    tarball: 'https://codeload.github.com/org/repo/tar.gz/abc',
+    gitHosted: true,
Relevance

●●● Strong

Team has accepted hardening/coverage around git-hosted tarball URL detection; missing-flag case is a
likely accepted regression test.

PR-#12491
PR-#12294

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test currently validates only the flagged git-hosted shape. However, other parts of the repo
explicitly treat git-hosted tarball URLs as git-hosted even without gitHosted, while
stripRegistryTarballUrls only exempts tarballs when the gitHosted field exists and is true,
creating an untested/mismatched predicate.

pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[90-103]
pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts[129-143]
pnpm11/resolving/resolver-base/test/index.ts[6-15]
pnpm11/resolving/npm-resolver/test/createNpmResolutionVerifier.test.ts[387-394]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new test asserts that git-hosted tarballs are preserved when `gitHosted: true` is present, but the broader codebase supports git-hosted tarball URLs even when `gitHosted` is omitted. The current `stripRegistryTarballUrls()` predicate only checks the `gitHosted` boolean, so a git-host URL without the flag would be stripped into integrity-only form.

### Issue Context
- Existing resolver/verification logic classifies git-hosted URLs as git-hosted based on the URL itself, not solely on the `gitHosted` field.
- The env-installer’s tarball stripping logic should align with that behavior (or explicitly document that it only supports the `gitHosted`-flagged representation).

### Fix Focus Areas
- pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[90-103]
- pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts[129-143]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


5. Historical comment: earlier pnpm 📘 Rule violation ⚙ Maintainability
Description
New comments describe historical behavior (e.g., 'written by an earlier pnpm') instead of only
current behavior/rationale. This can become misleading over time and violates the
no-historical-comments rule.
Code

pnpm/crates/cli/src/cli_args/pre_command.rs[R585-588]

+        // Entries that don't satisfy the bootstrap rules — e.g. resolutions
+        // carrying tarball URLs written by an earlier pnpm — are not an
+        // error: they are discarded and re-resolved afresh through the
+        // trusted bootstrap registries, which yields entries in the accepted
Relevance

●●● Strong

Team has accepted removing/rewording historical/provenance comments to avoid drift.

PR-#13592

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that describe past behavior using historical phrasing. The
cited comments explicitly reference an 'earlier pnpm' writing invalid entries, which is historical
framing rather than current behavior documentation.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/src/cli_args/pre_command.rs[585-588]
pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs[20-22]
pnpm/crates/env-installer/src/tests.rs[421-423]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Added comments reference historical implementations (e.g., "written by an earlier pnpm").

## Issue Context
Inline source comments should document current behavior/constraints and avoid temporal phrasing about prior versions/implementations.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pre_command.rs[585-589]
- pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs[20-22]
- pnpm/crates/env-installer/src/tests.rs[421-423]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


6. attemptSignatureVerification has 6 params ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
New TypeScript helpers take more than three positional parameters, making call sites harder to read
and evolve. This violates the project guideline to use an options object for larger parameter sets.
Code

pnpm11/deps/security/signatures/src/verifySignatures.ts[R537-540]

+async function attemptSignatureVerification (
+  pkg: InstalledPackageToVerify,
+  registry: string,
+  trustedKeys: RegistryKey[],
Relevance

●●● Strong

Clear precedent enforcing TS max-3-params rule by refactoring to options objects.

PR-#13464

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713433 limits TypeScript functions to three parameters or fewer. The new helper
signatures show 5 and 6 positional parameters, respectively, instead of an options object.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/deps/security/signatures/src/verifySignatures.ts[488-494]
pnpm11/deps/security/signatures/src/verifySignatures.ts[537-544]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New/modified TypeScript functions exceed the 3-parameter limit.

## Issue Context
The code introduces `findSignatureFailure(...)` (5 params) and `attemptSignatureVerification(...)` (6 params), which makes call sites positional and error-prone.

## Fix Focus Areas
- pnpm11/deps/security/signatures/src/verifySignatures.ts[488-508]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[537-548]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context used
✅ Compliance rules (platform): 26 rules

To customize comments, go to the Qodo configuration screen, or learn more in the docs.

Previous review results

Review updated until commit 09333a6

Results up to commit bdc4465 ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (1) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Canonical registry misdetected ✓ Resolved 🐞 Bug ⛨ Security
Description
Registry canonicality checks in both the Rust self-update verifier and the TS signatures verifier
use overly simplistic URL normalization (case + trailing slash only), so URL-equivalent forms of the
canonical npm registry (e.g. with an explicit :443) can be misclassified as “non-canonical.” This
can incorrectly trigger the new warn-and-proceed path and allow self-update/engine identity
verification to continue without a verified signature when canonical npm should fail closed under
signature acquisition failures.
Code

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[R478-480]

+fn equal_registries(left: &str, right: &str) -> bool {
+    with_trailing_slash(left).eq_ignore_ascii_case(&with_trailing_slash(right))
}
Relevance

●●● Strong

Security-sensitive registry verification; repo has precedent hardening URL handling/normalization in
verifiers.

PR-#12491

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
In Rust, tolerable_without_signature() depends on equal_registries() to decide whether the
configured registry is canonical, but equal_registries() only appends a trailing slash and
performs a case-insensitive string comparison, without URL parsing or normalization of default
ports/userinfo; likewise the PNPM_CONFIG_REGISTRY handling only appends a slash, so values like
https://registry.npmjs.org:443/ can persist into package_manager_bootstrap.registry and then
compare unequal to https://registry.npmjs.org/, enabling the non-canonical warn-and-proceed path.
In TS, the newly introduced local normalizeRegistryUrl() in the signatures verifier similarly does
not strip default ports, even though the repository already has (and tests) a URL-parsing-based
normalization helper that does, meaning canonical equality checks can fail for URL-equivalent
registry aliases such as https://registry.npmjs.org:443/.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[321-324]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[478-480]
pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[668-670]
pnpm/crates/config/src/lib.rs[2612-2617]
pnpm11/deps/security/signatures/src/verifySignatures.ts[577-583]
pnpm11/resolving/npm-resolver/src/normalizeRegistryUrl.ts[1-9]
pnpm11/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts[5-12]
pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[135-138]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Registry canonicality/equality decisions are currently based on simplistic string normalization (lowercasing + ensuring trailing slash), which fails for URL-equivalent canonical registry forms (notably explicit default ports like `:443`, and potentially userinfo). This can misclassify the canonical npm registry as “non-canonical,” incorrectly enabling the intended non-canonical-only warn-and-proceed behavior and allowing self-update / engine identity verification to proceed without a verified signature when canonical npm should fail closed if signatures are unobtainable.

## Issue Context
The change set intentionally allows “warn and proceed” only for *non-canonical* registries under the assumption the user explicitly trusts their custom registry; canonical npm is meant to remain a strict trust boundary where signature acquisition/verification failures should not be tolerated. However, Rust’s `equal_registries()` and config parsing, and TS’s new local `normalizeRegistryUrl()` (used for registry equality decisions), do not normalize URL-equivalent values (e.g. stripping default ports) even though the repo already contains a URL-parsing-based normalization utility (with tests) that does.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[321-324]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[478-480]
- pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs[668-670]
- pnpm/crates/config/src/lib.rs[2612-2617]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[577-583]
- pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[135-138]
- pnpm11/resolving/npm-resolver/src/normalizeRegistryUrl.ts[1-9]
- pnpm11/resolving/npm-resolver/test/normalizeRegistryUrl.test.ts[5-12]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended
2. Historical comment: earlier pnpm 📘 Rule violation ⚙ Maintainability
Description
New comments describe historical behavior (e.g., 'written by an earlier pnpm') instead of only
current behavior/rationale. This can become misleading over time and violates the
no-historical-comments rule.
Code

pnpm/crates/cli/src/cli_args/pre_command.rs[R585-588]

+        // Entries that don't satisfy the bootstrap rules — e.g. resolutions
+        // carrying tarball URLs written by an earlier pnpm — are not an
+        // error: they are discarded and re-resolved afresh through the
+        // trusted bootstrap registries, which yields entries in the accepted
Relevance

●●● Strong

Team has accepted removing/rewording historical/provenance comments to avoid drift.

PR-#13592

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 772199 forbids comments that describe past behavior using historical phrasing. The
cited comments explicitly reference an 'earlier pnpm' writing invalid entries, which is historical
framing rather than current behavior documentation.

Rule 772199: Comments must describe current behavior, not historical implementations
pnpm/crates/cli/src/cli_args/pre_command.rs[585-588]
pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs[20-22]
pnpm/crates/env-installer/src/tests.rs[421-423]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Added comments reference historical implementations (e.g., "written by an earlier pnpm").

## Issue Context
Inline source comments should document current behavior/constraints and avoid temporal phrasing about prior versions/implementations.

## Fix Focus Areas
- pnpm/crates/cli/src/cli_args/pre_command.rs[585-589]
- pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs[20-22]
- pnpm/crates/env-installer/src/tests.rs[421-423]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


3. attemptSignatureVerification has 6 params ✓ Resolved 📘 Rule violation ⚙ Maintainability
Description
New TypeScript helpers take more than three positional parameters, making call sites harder to read
and evolve. This violates the project guideline to use an options object for larger parameter sets.
Code

pnpm11/deps/security/signatures/src/verifySignatures.ts[R537-540]

+async function attemptSignatureVerification (
+  pkg: InstalledPackageToVerify,
+  registry: string,
+  trustedKeys: RegistryKey[],
Relevance

●●● Strong

Clear precedent enforcing TS max-3-params rule by refactoring to options objects.

PR-#13464

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
PR Compliance ID 713433 limits TypeScript functions to three parameters or fewer. The new helper
signatures show 5 and 6 positional parameters, respectively, instead of an options object.

Rule 713433: Limit TypeScript functions to three parameters or fewer
pnpm11/deps/security/signatures/src/verifySignatures.ts[488-494]
pnpm11/deps/security/signatures/src/verifySignatures.ts[537-544]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
New/modified TypeScript functions exceed the 3-parameter limit.

## Issue Context
The code introduces `findSignatureFailure(...)` (5 params) and `attemptSignatureVerification(...)` (6 params), which makes call sites positional and error-prone.

## Fix Focus Areas
- pnpm11/deps/security/signatures/src/verifySignatures.ts[488-508]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[537-548]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 9d273fe ⚖️ Balanced


🐞 Bugs (1) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Remediation recommended
1. Git-host URL mis-stripped 🐞 Bug ≡ Correctness
Description
The new test only asserts preserving git-hosted tarballs when gitHosted: true is present, but
elsewhere the codebase treats git-hosted tarball URLs as git-hosted even without this flag. This
leaves a compatibility case untested (and currently mishandled by stripRegistryTarballUrls), where
a git-host tarball URL without gitHosted could be rewritten into an integrity-only resolution.
Code

pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[R90-93]

+  expect(resolutionOf('[email protected]')).toEqual({
+    integrity: 'sha512-git',
+    tarball: 'https://codeload.github.com/org/repo/tar.gz/abc',
+    gitHosted: true,
Relevance

●●● Strong

Team has accepted hardening/coverage around git-hosted tarball URL detection; missing-flag case is a
likely accepted regression test.

PR-#12491
PR-#12294

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The test currently validates only the flagged git-hosted shape. However, other parts of the repo
explicitly treat git-hosted tarball URLs as git-hosted even without gitHosted, while
stripRegistryTarballUrls only exempts tarballs when the gitHosted field exists and is true,
creating an untested/mismatched predicate.

pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[90-103]
pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts[129-143]
pnpm11/resolving/resolver-base/test/index.ts[6-15]
pnpm11/resolving/npm-resolver/test/createNpmResolutionVerifier.test.ts[387-394]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The new test asserts that git-hosted tarballs are preserved when `gitHosted: true` is present, but the broader codebase supports git-hosted tarball URLs even when `gitHosted` is omitted. The current `stripRegistryTarballUrls()` predicate only checks the `gitHosted` boolean, so a git-host URL without the flag would be stripped into integrity-only form.

### Issue Context
- Existing resolver/verification logic classifies git-hosted URLs as git-hosted based on the URL itself, not solely on the `gitHosted` field.
- The env-installer’s tarball stripping logic should align with that behavior (or explicitly document that it only supports the `gitHosted`-flagged representation).

### Fix Focus Areas
- pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts[90-103]
- pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts[129-143]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Results up to commit 323cddd ⚖️ Balanced


🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)


Action required
1. Registry userinfo mishandled ✓ Resolved 🐞 Bug ⛨ Security
Description
verifyInstalledPackageSignatures() now includes pkg.registry verbatim in
InstalledSignatureFailure, which can expose inline user:pass@ credentials and also makes
canonical-registry decisions treat URL userinfo as significant. As a result, a canonical npm
registry configured as https://user:[email protected]/ can be misclassified as non-canonical
and incorrectly allow the new warn-and-proceed path.
Code

pnpm11/deps/security/signatures/src/verifySignatures.ts[R483-486]

+    const failure = await findSignatureFailure(pkg, ctx)
    if (failure != null) {
-      failures.push({ name: pkg.name, version: pkg.version, ...failure })
+      failures.push({ name: pkg.name, version: pkg.version, registry: pkg.registry, ...failure })
    }
Relevance

●●● Strong

Team has recent accepted fixes to redact URL-embedded credentials in errors/output; same leakage
risk here.

PR-#12519
PR-#13230
PR-#12786

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The new code now pushes pkg.registry into the returned failures list without sanitization, and
canonicality decisions in the engine verifier rely on equalRegistries() which normalizes URLs but
does not strip userinfo. The pnpm11 error utilities explicitly document that registries can carry
inline user:pass@ credentials and that these must be redacted to prevent leakage.

pnpm11/deps/security/signatures/src/verifySignatures.ts[473-486]
pnpm11/deps/security/signatures/src/verifySignatures.ts[592-603]
pnpm11/core/error/src/index.ts[65-71]
pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts[112-139]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`InstalledSignatureFailure.registry` is populated with the raw `pkg.registry` string. Registry URLs may legally contain inline basic-auth userinfo (`https://user:pass@host/`), which should never appear in returned/serializable structures.

Additionally, registry canonicality checks should treat URL userinfo as irrelevant. Keeping it in the normalized form causes `https://user:[email protected]/` to compare unequal to the canonical `https://registry.npmjs.org/`, weakening fail-closed decisions keyed on “is this canonical?”.

### Issue Context
- The repo already documents that registries can contain inline credentials and that they must be redacted/sanitized before they reach user-visible output.
- `verifyPnpmEngineIdentity()` uses `equalRegistries(failure.registry, CANONICAL_NPM_REGISTRY)` to decide whether an unverifiable signature can be tolerated; if `failure.registry` retains userinfo, the canonical registry can be incorrectly treated as “non-canonical”.

### Fix Focus Areas
- pnpm11/deps/security/signatures/src/verifySignatures.ts[483-486]
- pnpm11/deps/security/signatures/src/verifySignatures.ts[592-603]

### What to change
1. Introduce a small helper to sanitize registry URLs for both comparison and reporting:
  - Parse with `new URL(...)` when possible.
  - Clear `url.username` and `url.password`.
  - Preserve existing normalization behavior (trailing slash, default-port elision, host case-insensitivity).
  - On parse failure, fall back to string processing that at minimum strips `user:pass@` after a scheme (or reuse an existing helper if available in the pnpm11 TS stack).
2. Use the sanitized form:
  - In `equalRegistries()` / `normalizeRegistryUrl()` (so comparisons ignore userinfo).
  - When populating `InstalledSignatureFailure.registry` (so returned results cannot contain credentials).
3. Add a regression test (in the relevant consumer tests) asserting that a canonical registry with inline userinfo is still recognized as canonical for fail-closed decisions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Qodo Logo

@qodo-code-review

qodo-code-review Bot commented Aug 8, 2026 •

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to 09333a6

Warning

/improve is deprecated. Use /agentic_review instead (removal date not yet scheduled).

CategorySuggestion                                                                                                                                    Impact
Security
Prevent fallback credential disclosure

Use URL-only auth lookup for the canonical fallback registry to avoid leaking
private scoped credentials.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs [597-599]

-.for_url_with_package(&packument_url, &component.name)
+if equal_registries(registry, &component.registry) {
+    config.auth.for_url_with_package(&packument_url, &component.name)
+} else {
+    config.auth.for_url(&packument_url)
+}

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 9

__

Why: Prevents a potential security vulnerability where private registry credentials could be leaked to the public fallback registry when resolving for_url_with_package.

High
Prevent empty-failure verification bypass

Check that the failures array is not empty before conditionally bypassing
identity verification.

pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts [112-118]

-if (result.failures.every(isTolerableWithoutSignature)) {
+if (
+  result.failures.length > 0 &&
+  result.failures.every(isTolerableWithoutSignature)
+) {
   globalWarn(
     `The authenticity of pnpm@${pnpmVersion} could not be verified against npm's registry signatures: ${describe(result.failures)}. ` +
     'Proceeding anyway, because the release was resolved through the registry configured in your own (non-project) configuration and stays pinned by its integrity checksum.'
   )
   return
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: The every method returns true for an empty array, which could inadvertently bypass security checks if the failures array is empty when verified is false.

Medium
Possible issue
Preserve explicit tarball resolutions

Check resolved_via before stripping the tarball URL to preserve explicit HTTPS
tarball dependencies.

pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs [78-80]

 let mut metadata =
     package_metadata(&package.name, &package.version, &package.result, registry, false);
-metadata.resolution = strip_registry_tarball_url(metadata.resolution);
+if package.result.resolved_via == "npm-registry" {
+    metadata.resolution = strip_registry_tarball_url(metadata.resolution);
+}

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 8

__

Why: Fixes a critical bug where explicit HTTPS tarball dependencies for the package manager would be incorrectly stripped of their URLs, breaking installation.

Medium
Preserve direct remote tarball resolutions

Exclude direct remote-tarball dependencies from having their tarball URLs
stripped by checking the depPath.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts [130-143]

-for (const pkg of Object.values(lockfile.packages ?? {})) {
+for (const [depPath, pkg] of Object.entries(lockfile.packages ?? {})) {
   const resolution = pkg.resolution
   if (
     resolution == null ||
     !('integrity' in resolution) || !resolution.integrity ||
     !('tarball' in resolution) || typeof resolution.tarball !== 'string' ||
     resolution.tarball.startsWith('file:') ||
+    depPath.includes('://') ||
     ('gitHosted' in resolution && resolution.gitHosted === true) ||
     ('path' in resolution && resolution.path != null)
   ) {
     continue
   }
   pkg.resolution = { integrity: resolution.integrity }
 }

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: Stripping the tarball URL from direct remote-tarball dependencies could break their installation, as they would be wrongly treated as registry packages.

Medium
  • Update

Previous suggestions

Suggestions up to commit b66de95
CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve direct tarball dependency URLs

Restrict tarball URL stripping to dependencies explicitly resolved from a
package registry. This prevents direct HTTP tarball dependencies from losing
their fetchable URLs.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts [131-144]

-for (const pkg of Object.values(lockfile.packages ?? {})) {
+for (const [depPath, pkg] of Object.entries(lockfile.packages ?? {})) {
   const resolution = pkg.resolution
   if (
     resolution == null ||
+    !isRegistryDepPath(depPath) ||
     !('integrity' in resolution) || !resolution.integrity ||
     !('tarball' in resolution) || typeof resolution.tarball !== 'string' ||
     resolution.tarball.startsWith('file:') ||
     ('gitHosted' in resolution && resolution.gitHosted === true) ||
     ('path' in resolution && resolution.path != null)
   ) {
     continue
   }
   pkg.resolution = { integrity: resolution.integrity }
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion identifies a valid edge case where direct HTTP tarball dependencies could incorrectly lose their fetch URL, though it requires ensuring isRegistryDepPath is implemented or appropriately imported.

Low
Suggestions up to commit 323cddd
CategorySuggestion                                                                                                                                    Impact
Possible issue
Preserve case-sensitive registry URL components

Avoid lowercasing the entire registry URL when normalizing. Rely on the URL
object's built-in normalization to correctly handle case-insensitive hosts while
preserving the case of paths and query strings.

pnpm11/deps/security/signatures/src/verifySignatures.ts [592-604]

 export function equalRegistries (a: string, b: string): boolean {
   return normalizeRegistryUrl(a) === normalizeRegistryUrl(b)
 }
 
 function normalizeRegistryUrl (registry: string): string {
   const withSlash = registry.endsWith('/') ? registry : `${registry}/`
   try {
-    // URL normalization lowercases the host and drops a default port.
-    return new url.URL(withSlash).toString().toLowerCase()
+    // URL normalization lowercases the scheme and host and drops a default port.
+    return new url.URL(withSlash).toString()
   } catch {
-    return withSlash.toLowerCase()
+    return withSlash
   }
 }
Suggestion importance[1-10]: 8

__

Why: Lowercasing the entire URL causes case-sensitive components like paths to mismatch, potentially misclassifying different registries as identical and improperly skipping security verification.

Medium
Preserve case-sensitive registry URL paths

Avoid using eq_ignore_ascii_case to compare entire registry URLs. Rely on the
url::Url parser's default normalization to canonicalize hosts and ports while
preserving the case of paths.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs [484-492]

 fn equal_registries(left: &str, right: &str) -> bool {
-    normalize_registry_url(left).eq_ignore_ascii_case(&normalize_registry_url(right))
+    normalize_registry_url(left) == normalize_registry_url(right)
 }
 
 fn normalize_registry_url(registry: &str) -> String {
     let with_slash = with_trailing_slash(registry);
     // URL normalization lowercases the host and drops a default port.
     url::Url::parse(&with_slash).map(String::from).unwrap_or(with_slash)
 }
Suggestion importance[1-10]: 8

__

Why: Comparing the entire URL using eq_ignore_ascii_case ignores the case-sensitivity of path components, which could misclassify distinct registries as identical and inadvertently skip the fallback verification.

Medium
Preserve direct HTTPS tarball dependencies

Verify if a dependency is a registry package before stripping its tarball URL to
avoid breaking direct HTTPS dependencies. Use the dependency path for
classification.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts [131-144]

-for (const pkg of Object.values(lockfile.packages ?? {})) {
+for (const [depPath, pkg] of Object.entries(lockfile.packages ?? {})) {
   const resolution = pkg.resolution
   if (
+    !isRegistryPackageDepPath(depPath) ||
     resolution == null ||
     !('integrity' in resolution) || !resolution.integrity ||
-    !('tarball' in resolution) || typeof resolution.tarball !== 'string' ||
-    resolution.tarball.startsWith('file:') ||
-    ('gitHosted' in resolution && resolution.gitHosted === true) ||
-    ('path' in resolution && resolution.path != null)
+    !('tarball' in resolution) || typeof resolution.tarball !== 'string'
   ) {
     continue
   }
   pkg.resolution = { integrity: resolution.integrity }
 }
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly identifies an edge case where direct HTTPS tarball dependencies could be inadvertently stripped of their URLs, though this is rare for standard pnpm package resolutions.

Low
✅ Suggestions up to commit 9d273fe
CategorySuggestion                                                                                                                                    Impact
Security
Compare registry URLs safely

Avoid lowercasing the entire registry URL to preserve path case sensitivity, and
trim trailing dots from the hostname.

pnpm11/deps/security/signatures/src/verifySignatures.ts [589-597]

 function normalizeRegistryUrl (registry: string): string {
   const withSlash = registry.endsWith('/') ? registry : `${registry}/`
   try {
-    // URL normalization lowercases the host and drops a default port.
-    return new url.URL(withSlash).toString().toLowerCase()
+    const parsed = new url.URL(withSlash)
+    parsed.hostname = parsed.hostname.replace(/\.+$/, '')
+    return parsed.toString()
   } catch {
-    return withSlash.toLowerCase()
+    return withSlash
   }
 }
Suggestion importance[1-10]: 8

__

Why: Lowercasing the entire URL corrupts case-sensitive URL paths, and stripping trailing dots prevents an FQDN bypass of the canonical registry check.

Medium
Normalize DNS-equivalent registry hosts

Trim trailing dots from registry hostnames before comparing them.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs [488-492]

 fn normalize_registry_url(registry: &str) -> String {
     let with_slash = with_trailing_slash(registry);
-    // URL normalization lowercases the host and drops a default port.
-    url::Url::parse(&with_slash).map(String::from).unwrap_or(with_slash)
+    let Ok(mut parsed) = url::Url::parse(&with_slash) else {
+        return with_slash;
+    };
+    if let Some(host) = parsed.host_str() {
+        let normalized_host = host.trim_end_matches('.').to_string();
+        if parsed.set_host(Some(&normalized_host)).is_err() {
+            return with_slash;
+        }
+    }
+    String::from(parsed)
 }
Suggestion importance[1-10]: 7

__

Why: Trimming trailing dots from FQDNs prevents an obscure bypass of the canonical registry fail-closed security mechanism.

Medium
Possible issue
Preserve explicit tarball dependencies

Only convert tarball resolutions to registry resolutions when they were resolved
via an npm registry.

pnpm/crates/env-installer/src/resolve_package_manager_integrities.rs [78-80]

 let mut metadata =
     package_metadata(&package.name, &package.version, &package.result, registry, false);
-metadata.resolution = strip_registry_tarball_url(metadata.resolution);
+if package.result.resolved_via == "npm-registry" {
+    metadata.resolution = strip_registry_tarball_url(metadata.resolution);
+}
Suggestion importance[1-10]: 8

__

Why: Checking resolved_via prevents inadvertently breaking explicit remote tarball dependencies that happen to include an integrity field.

Medium
Preserve direct HTTPS tarball resolutions

Preserve direct HTTPS tarball resolutions when stripping registry tarball URLs.
This prevents installation failures by verifying the package-resolution
provenance.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts [129-144]

 function stripRegistryTarballUrls (lockfile: LockfileObject): void {
-  for (const pkg of Object.values(lockfile.packages ?? {})) {
+  for (const [depPath, pkg] of Object.entries(lockfile.packages ?? {})) {
     const resolution = pkg.resolution
     if (
+      !isRegistryPackageSnapshot(depPath, pkg) ||
       resolution == null ||
       !('integrity' in resolution) || !resolution.integrity ||
-      !('tarball' in resolution) || typeof resolution.tarball !== 'string' ||
-      resolution.tarball.startsWith('file:') ||
-      ('gitHosted' in resolution && resolution.gitHosted === true) ||
-      ('path' in resolution && resolution.path != null)
+      !('tarball' in resolution) || typeof resolution.tarball !== 'string'
     ) {
       continue
     }
     pkg.resolution = { integrity: resolution.integrity }
   }
 }
Suggestion importance[1-10]: 8

__

Why: The suggestion correctly identifies a potential bug where direct HTTPS tarballs might incorrectly have their URLs stripped, which would break their installation.

Medium
Suggestions
CategorySuggestion                                                                                                                                    Impact
Security
✅ Harden canonical registry URL comparison
Suggestion Impact:The commit changed registry normalization to use redact_and_sanitize, stripping credentials and sanitizing non-identity URL components before comparison. However, it retained case-insensitive comparison rather than adopting the suggested case-sensitive comparison, so the suggestion was only partially implemented.

code diff:

@@ -480,13 +488,15 @@
 /// are implied — or a canonical registry written as e.g.
 /// `https://Registry.NPMJS.org:443/` would be misclassified as a different,
 /// non-canonical one, weakening fail-closed decisions keyed on whether the
-/// registry is the canonical one.
+/// registry is the canonical one. Inline `user:pass@` credentials are auth
+/// material, not identity, so they are stripped before comparing for the
+/// same reason.
 fn equal_registries(left: &str, right: &str) -> bool {
     normalize_registry_url(left).eq_ignore_ascii_case(&normalize_registry_url(right))
 }
 
 fn normalize_registry_url(registry: &str) -> String {
-    let with_slash = with_trailing_slash(registry);
+    let with_slash = redact_and_sanitize(&with_trailing_slash(registry));
     // URL normalization lowercases the host and drops a default port.
     url::Url::parse(&with_slash).map(String::from).unwrap_or(with_slash)
 }

Strip credentials, query parameters, and fragments from URLs before comparing
them, and use case-sensitive comparison. This ensures that non-essential URL
components don't bypass security-critical registry equivalence checks.

pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs [484-492]

 fn equal_registries(left: &str, right: &str) -> bool {
-    normalize_registry_url(left).eq_ignore_ascii_case(&normalize_registry_url(right))
+    normalize_registry_url(left) == normalize_registry_url(right)
 }
 
 fn normalize_registry_url(registry: &str) -> String {
     let with_slash = with_trailing_slash(registry);
-    // URL normalization lowercases the host and drops a default port.
-    url::Url::parse(&with_slash).map(String::from).unwrap_or(with_slash)
+    let Ok(mut url) = url::Url::parse(&with_slash) else {
+        return with_slash;
+    };
+    let _ = url.set_username("");
+    let _ = url.set_password(None);
+    url.set_query(None);
+    url.set_fragment(None);
+    url.into()
 }
Suggestion importance[1-10]: 8

__

Why: The suggestion identifies a valid security flaw where unstripped components (like query parameters) or case-insensitive path comparisons could allow a canonical URL to be misclassified as non-canonical, bypassing the fail-closed check.

Medium
Possible issue
Preserve direct tarball dependency URLs

Use explicit registry-origin tracking instead of heuristics to strip tarball
URLs. This prevents potential issues with direct HTTPS tarball dependencies
losing their fetch location.

pnpm11/installing/env-installer/src/resolvePackageManagerIntegrities.ts [129-144]

-function stripRegistryTarballUrls (lockfile: LockfileObject): void {
-  for (const pkg of Object.values(lockfile.packages ?? {})) {
+function stripRegistryTarballUrls (
+  lockfile: LockfileObject,
+  registryResolvedDepPaths: ReadonlySet<string>
+): void {
+  for (const [depPath, pkg] of Object.entries(lockfile.packages ?? {})) {
+    if (!registryResolvedDepPaths.has(depPath)) continue
+
     const resolution = pkg.resolution
     if (
       resolution == null ||
       !('integrity' in resolution) || !resolution.integrity ||
-      !('tarball' in resolution) || typeof resolution.tarball !== 'string' ||
-      resolution.tarball.startsWith('file:') ||
-      ('gitHosted' in resolution && resolution.gitHosted === true) ||
-      ('path' in resolution && resolution.path != null)
+      !('tarball' in resolution) || typeof resolution.tarball !== 'string'
     ) {
       continue
     }
     pkg.resolution = { integrity: resolution.integrity }
   }
 }
Suggestion importance[1-10]: 5

__

Why: The current heuristic could accidentally strip URLs from direct HTTPS tarball dependencies, but since stripRegistryTarballUrls only processes pnpm's own dependency tree (which avoids such dependencies), the practical risk is low.

Low

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Integrated-Benchmark Report (Linux)

Commit: 09333a61c3c9

Regular scenarios report direct and pnpr installs. The peer-heavy resolver scenario compares current Rust, main Rust, and TypeScript pnpm. Bencher consumes pacquet@HEAD and pnpr@HEAD.

The tables below show mean ± σ; Bencher thresholds on the minimum latency, which is far less perturbed by shared-runner contention (noise only adds time).

Scenario: Isolated linker: fresh restore, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.490 ± 0.135 2.352 2.719 1.64 ± 0.17
pacquet@main 2.533 ± 0.166 2.344 2.767 1.67 ± 0.19
pnpr@HEAD 1.518 ± 0.139 1.368 1.753 1.00
pnpr@main 1.520 ± 0.135 1.353 1.782 1.00 ± 0.13
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.49009939364,
      "stddev": 0.13454831885069826,
      "median": 2.4542165526399997,
      "user": 1.7044919999999997,
      "system": 1.3119212199999999,
      "min": 2.3521558371399998,
      "max": 2.7193407761399997,
      "times": [
        2.3521558371399998,
        2.36654298614,
        2.4633141991399996,
        2.7193407761399997,
        2.3552687251399997,
        2.50220833214,
        2.42921018414,
        2.44511890614,
        2.70442196514,
        2.56341202514
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.53292229814,
      "stddev": 0.1657206761646974,
      "median": 2.5000710586399997,
      "user": 1.7023839999999997,
      "system": 1.28722332,
      "min": 2.34361865814,
      "max": 2.76679924414,
      "times": [
        2.34705327014,
        2.67399251314,
        2.3533660741399998,
        2.76679924414,
        2.34361865814,
        2.54754726514,
        2.44639710914,
        2.71735432514,
        2.6804996701399997,
        2.45259485214
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.51756928024,
      "stddev": 0.13888089443638174,
      "median": 1.48807252264,
      "user": 1.1946933999999998,
      "system": 1.1477083199999998,
      "min": 1.36804001114,
      "max": 1.75267112714,
      "times": [
        1.44969406014,
        1.37827975314,
        1.54397950914,
        1.36804001114,
        1.75267112714,
        1.57336757014,
        1.52645098514,
        1.4007251171400001,
        1.73881061814,
        1.4436740511400001
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.52046697064,
      "stddev": 0.13504562204074597,
      "median": 1.53424912414,
      "user": 1.2267725,
      "system": 1.1084204199999999,
      "min": 1.35298649314,
      "max": 1.78166435914,
      "times": [
        1.37460222814,
        1.53073373614,
        1.5991268521400002,
        1.6454805301400002,
        1.78166435914,
        1.54803206214,
        1.35298649314,
        1.45069697114,
        1.53776451214,
        1.38358196214
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 259.7 ± 8.6 249.3 272.9 1.02 ± 0.05
pacquet@main 254.8 ± 7.6 246.3 269.9 1.00
pnpr@HEAD 269.5 ± 8.8 258.3 280.5 1.06 ± 0.05
pnpr@main 270.8 ± 4.1 265.4 276.9 1.06 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.2596807668,
      "stddev": 0.008645772805398199,
      "median": 0.2597274794,
      "user": 0.1979859,
      "system": 0.5265691800000001,
      "min": 0.2492786894,
      "max": 0.2728528524,
      "times": [
        0.27108940140000004,
        0.2728528524,
        0.25729135740000003,
        0.2656697504,
        0.2492823284,
        0.26325206440000004,
        0.2492786894,
        0.2539693344,
        0.2621636014,
        0.2519582884
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.25479580929999995,
      "stddev": 0.007622286596930377,
      "median": 0.25269099940000006,
      "user": 0.20828149999999995,
      "system": 0.50306038,
      "min": 0.2463018694,
      "max": 0.2698866244,
      "times": [
        0.2508469964,
        0.24640055940000002,
        0.2698866244,
        0.2525234394,
        0.2590018274,
        0.2648502904,
        0.25274868640000003,
        0.25263331240000003,
        0.2463018694,
        0.2527644874
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.2694944811,
      "stddev": 0.008764549876845466,
      "median": 0.27067555790000003,
      "user": 0.21621859999999993,
      "system": 0.50470988,
      "min": 0.2583238754,
      "max": 0.2804623624,
      "times": [
        0.2804623624,
        0.2583238754,
        0.2635706404,
        0.2790452244,
        0.27747651240000004,
        0.27364647940000003,
        0.26770463640000003,
        0.2756083134,
        0.2601800104,
        0.2589267564
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.27076132710000006,
      "stddev": 0.004097261602657831,
      "median": 0.2696812809,
      "user": 0.20521060000000002,
      "system": 0.50890388,
      "min": 0.26542766840000004,
      "max": 0.2769160774,
      "times": [
        0.26542766840000004,
        0.2733993344,
        0.2661770624,
        0.26802856540000003,
        0.2769160774,
        0.2730785234,
        0.2684473464,
        0.2767761314,
        0.2694790684,
        0.2698834934
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + cold store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 2.582 ± 0.010 2.564 2.595 1.59 ± 0.11
pacquet@main 2.577 ± 0.010 2.564 2.596 1.58 ± 0.11
pnpr@HEAD 1.675 ± 0.145 1.429 1.856 1.03 ± 0.11
pnpr@main 1.629 ± 0.114 1.460 1.833 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 2.5818789319599995,
      "stddev": 0.00978350724578702,
      "median": 2.58308392896,
      "user": 1.6404804199999998,
      "system": 1.37022806,
      "min": 2.56398265296,
      "max": 2.5949291959600003,
      "times": [
        2.5949291959600003,
        2.5908456989600004,
        2.58661541296,
        2.58969269796,
        2.5681824139600002,
        2.58208899096,
        2.57917954196,
        2.58407886696,
        2.57919384696,
        2.56398265296
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 2.57736650816,
      "stddev": 0.010294049879074885,
      "median": 2.5754868984600003,
      "user": 1.6675727199999997,
      "system": 1.3303821599999999,
      "min": 2.5639769499600003,
      "max": 2.5959648959600004,
      "times": [
        2.57163753796,
        2.58067693296,
        2.57612539996,
        2.58203715396,
        2.59138298596,
        2.5959648959600004,
        2.5694079529600002,
        2.56760687496,
        2.5639769499600003,
        2.5748483969600002
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 1.67463060826,
      "stddev": 0.14453650878321647,
      "median": 1.68810308546,
      "user": 1.17201252,
      "system": 1.1670014600000003,
      "min": 1.4289292389600001,
      "max": 1.85626660996,
      "times": [
        1.7985421869600002,
        1.8241318399600002,
        1.64405985496,
        1.4289292389600001,
        1.6430757769600002,
        1.69655726496,
        1.4472823729600002,
        1.6796489059600002,
        1.72781203096,
        1.85626660996
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 1.6287899634600003,
      "stddev": 0.11365012597054645,
      "median": 1.60725221896,
      "user": 1.16655042,
      "system": 1.1647272599999998,
      "min": 1.4596068099600001,
      "max": 1.8328987959600003,
      "times": [
        1.4596068099600001,
        1.6821647469600003,
        1.4865852109600002,
        1.59373034096,
        1.8328987959600003,
        1.58854910596,
        1.6953196379600002,
        1.5833419279600003,
        1.7449289609600003,
        1.62077409696
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, hot cache + hot store

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 426.0 ± 12.2 409.7 453.2 1.42 ± 0.06
pacquet@main 407.6 ± 17.5 382.5 440.2 1.36 ± 0.07
pnpr@HEAD 300.7 ± 9.0 291.1 318.9 1.00
pnpr@main 301.4 ± 7.3 291.3 312.3 1.00 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.42595457334,
      "stddev": 0.01219930624628448,
      "median": 0.42201105274,
      "user": 0.5214425199999999,
      "system": 0.6914732800000001,
      "min": 0.40968550924,
      "max": 0.45322006124,
      "times": [
        0.43882330524,
        0.42191562024,
        0.41753045124,
        0.41987771324,
        0.45322006124,
        0.42202318324,
        0.42912260424,
        0.42534836324,
        0.40968550924,
        0.42199892224
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.40759618594,
      "stddev": 0.017508179697452456,
      "median": 0.40718042624,
      "user": 0.49755781999999993,
      "system": 0.67471278,
      "min": 0.38245620624,
      "max": 0.44016156424,
      "times": [
        0.44016156424,
        0.40335428924,
        0.38245620624,
        0.39115205524,
        0.40484740624,
        0.38961993824,
        0.40951344624,
        0.42381014324,
        0.41028172324,
        0.42076508724
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30074357304,
      "stddev": 0.009042399033697206,
      "median": 0.29942653874,
      "user": 0.19090622,
      "system": 0.5052694799999999,
      "min": 0.29106102223999997,
      "max": 0.31890501024,
      "times": [
        0.29166051324,
        0.31120773124,
        0.29964525424,
        0.29373438124,
        0.29106102223999997,
        0.30141577824,
        0.30607639524,
        0.29452182124,
        0.31890501024,
        0.29920782324
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30143685034,
      "stddev": 0.00725762101688631,
      "median": 0.29935498924,
      "user": 0.18237022000000003,
      "system": 0.5175647800000001,
      "min": 0.29132393724,
      "max": 0.31228273423999997,
      "times": [
        0.30092150223999997,
        0.30584431124,
        0.29572440224,
        0.29636565224,
        0.29132393724,
        0.31228273423999997,
        0.29552508924,
        0.30782741324,
        0.29778847624,
        0.31076498524
      ]
    }
  ]
}

Scenario: Isolated linker: fresh install, cold cache + hot store

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 1.728 ± 0.005 1.717 1.736 5.72 ± 0.16
pacquet@main 1.720 ± 0.008 1.706 1.736 5.69 ± 0.16
pnpr@HEAD 0.303 ± 0.004 0.297 0.309 1.00 ± 0.03
pnpr@main 0.302 ± 0.009 0.295 0.324 1.00
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 1.7279947228799997,
      "stddev": 0.005486458656346673,
      "median": 1.7270251734800002,
      "user": 0.75832708,
      "system": 0.78007118,
      "min": 1.71680986498,
      "max": 1.73635653498,
      "times": [
        1.7342048539800001,
        1.72544310998,
        1.7312078139800002,
        1.72516707998,
        1.72609862398,
        1.7267214909800002,
        1.7273288559800002,
        1.73635653498,
        1.73060899998,
        1.71680986498
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 1.7195961754800002,
      "stddev": 0.008301477277182426,
      "median": 1.71999359548,
      "user": 0.7601427799999999,
      "system": 0.7511593799999999,
      "min": 1.70589421798,
      "max": 1.73553356498,
      "times": [
        1.71815619098,
        1.73553356498,
        1.70589421798,
        1.72556747898,
        1.71373120698,
        1.72183099998,
        1.72402940798,
        1.7166080039800002,
        1.7117247579800001,
        1.72288592498
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.30267835538000004,
      "stddev": 0.003952200149766266,
      "median": 0.30243475598,
      "user": 0.18162407999999997,
      "system": 0.51786808,
      "min": 0.29690969798,
      "max": 0.30937044798,
      "times": [
        0.30547096998,
        0.30100384498,
        0.30605448898,
        0.29821951798,
        0.30003106798,
        0.29690969798,
        0.30047007798,
        0.30937044798,
        0.30538777298,
        0.30386566698
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.30196655678,
      "stddev": 0.008626029970315956,
      "median": 0.29971377398,
      "user": 0.16982177999999998,
      "system": 0.52567878,
      "min": 0.29450886798,
      "max": 0.32359165198,
      "times": [
        0.30494582798000003,
        0.30582235598,
        0.29690909198,
        0.29450886798,
        0.30165330298,
        0.29612583598000003,
        0.30301634898,
        0.29531803898000003,
        0.29777424498,
        0.32359165198
      ]
    }
  ]
}

Scenario: Isolated linker: fresh resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 234.2 ± 20.0 202.5 259.0 2.63 ± 0.24
pacquet@main 228.2 ± 11.5 215.6 250.7 2.56 ± 0.15
pnpr@HEAD 89.1 ± 2.8 85.8 99.1 1.00
pnpr@main 90.5 ± 3.2 85.1 97.6 1.01 ± 0.05
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.23424047431636366,
      "stddev": 0.01997919616136013,
      "median": 0.23702685768000004,
      "user": 0.1649777727272727,
      "system": 0.0862891818181818,
      "min": 0.20247808868000003,
      "max": 0.25900615368,
      "times": [
        0.25188330768,
        0.25416328968,
        0.21838021168000002,
        0.25900615368,
        0.20247808868000003,
        0.25135995168,
        0.21152488568000002,
        0.23702685768000004,
        0.22208674568000003,
        0.21944850068000002,
        0.24928722468000003
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.22820117791076924,
      "stddev": 0.011496227244060915,
      "median": 0.22795034968000003,
      "user": 0.16497111538461537,
      "system": 0.0812663076923077,
      "min": 0.21556505868000003,
      "max": 0.25073248668000003,
      "times": [
        0.21583491268000002,
        0.23752174768000003,
        0.22795034968000003,
        0.23024606968000003,
        0.24448706668000003,
        0.21556505868000003,
        0.21804925968000002,
        0.22548350168000003,
        0.23634524368000004,
        0.22948329468000003,
        0.21769651168000004,
        0.25073248668000003,
        0.21721980968000001
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 0.08914786516484852,
      "stddev": 0.0027788623642940333,
      "median": 0.08868928268000001,
      "user": 0.020783348484848488,
      "system": 0.01137890909090909,
      "min": 0.08581909568,
      "max": 0.09905894168,
      "times": [
        0.08581909568,
        0.08643584368,
        0.08643954168000001,
        0.08731530168,
        0.08601043968000001,
        0.08699818368000001,
        0.08743991068,
        0.08687979668,
        0.08630334068,
        0.08739535868000001,
        0.09069727368000001,
        0.08764229268,
        0.09283900368,
        0.09905894168,
        0.08929907568,
        0.09100016768000001,
        0.08827106468,
        0.09145139468,
        0.08892573068000001,
        0.08868928268000001,
        0.09086628868,
        0.09243282968000001,
        0.09161925868000001,
        0.08901337568,
        0.09071638368,
        0.08726460068,
        0.09106221668,
        0.09266885868000001,
        0.08623387568,
        0.09076514668,
        0.08827749768,
        0.08893235568,
        0.08711582168
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 0.09046632955096774,
      "stddev": 0.0032070874358151383,
      "median": 0.09047748868000001,
      "user": 0.02108779032258065,
      "system": 0.012475903225806452,
      "min": 0.08510287868000001,
      "max": 0.09763329668000001,
      "times": [
        0.08983049568,
        0.08613544868,
        0.08691736668,
        0.08695412968,
        0.09047748868000001,
        0.08774406568,
        0.08981383768000001,
        0.09175958768,
        0.09142005568,
        0.08661274368,
        0.08510287868000001,
        0.08634817168,
        0.08693361268000001,
        0.09172124568000001,
        0.09114765468000001,
        0.09180784868,
        0.09763329668000001,
        0.09368076468,
        0.09031229868,
        0.09119976668,
        0.09193553568,
        0.08892443268,
        0.09603503968,
        0.09222905268,
        0.09133362168,
        0.08971837368,
        0.08773318368000001,
        0.09523861068,
        0.08824878268,
        0.09598058368000001,
        0.09352624068
      ]
    }
  ]
}

Scenario: Isolated linker: peer-heavy resolve, hot cache, offline

Command Mean [ms] Min [ms] Max [ms] Relative
pacquet@HEAD 740.4 ± 178.1 559.9 1080.1 1.00
pacquet@main 770.6 ± 218.2 521.9 1133.7 1.04 ± 0.39
pnpm@HEAD 3051.0 ± 191.7 2869.9 3318.3 4.12 ± 1.02
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 0.7403921344,
      "stddev": 0.1781424362591088,
      "median": 0.6555448314,
      "user": 0.6766465355555555,
      "system": 0.15146476444444443,
      "min": 0.5599092304,
      "max": 1.0800682534000001,
      "times": [
        0.5912157294,
        0.8921854444,
        0.5599092304,
        0.6201284554000001,
        0.9112912284,
        1.0800682534000001,
        0.7050490854,
        0.6555448314,
        0.6481369514
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 0.7706495777333333,
      "stddev": 0.21822069278077535,
      "median": 0.7323375024000001,
      "user": 0.7124693133333334,
      "system": 0.15504865333333331,
      "min": 0.5218930934,
      "max": 1.1337181764000002,
      "times": [
        0.7323375024000001,
        1.1337181764000002,
        1.1189727084,
        0.6456518354,
        0.5218930934,
        0.5669498854,
        0.7829630604,
        0.7428686334,
        0.6904913044000001
      ]
    },
    {
      "command": "pnpm@HEAD",
      "mean": 3.050985459844445,
      "stddev": 0.19169019656539615,
      "median": 2.9282265254000004,
      "user": 4.315049202222222,
      "system": 0.306011431111111,
      "min": 2.8699255144,
      "max": 3.3183374024,
      "times": [
        2.8699255144,
        2.9005721264,
        3.2286625514000002,
        2.8837532894,
        2.9282265254000004,
        3.3183374024,
        3.1267597834000003,
        3.3033847024000003,
        2.8992472434
      ]
    }
  ]
}

Scenario: Isolated linker: fresh restore, cold cache + cold store + cold pnpr

Command Mean [s] Min [s] Max [s] Relative
pacquet@HEAD 4.492 ± 0.135 4.423 4.867 1.27 ± 0.05
pacquet@main 4.566 ± 0.132 4.414 4.780 1.29 ± 0.05
pnpr@HEAD 3.542 ± 0.082 3.458 3.695 1.00
pnpr@main 3.561 ± 0.123 3.450 3.863 1.01 ± 0.04
BENCHMARK_REPORT.json
{
  "results": [
    {
      "command": "pacquet@HEAD",
      "mean": 4.492093687900001,
      "stddev": 0.13535788108136296,
      "median": 4.443292101999999,
      "user": 1.8593794600000002,
      "system": 1.4445896,
      "min": 4.4226558475,
      "max": 4.8670801825,
      "times": [
        4.4571055274999996,
        4.4310614435,
        4.508295534499999,
        4.4227155545,
        4.4261558265,
        4.4992827585,
        4.454947864499999,
        4.4226558475,
        4.4316363395,
        4.8670801825
      ]
    },
    {
      "command": "pacquet@main",
      "mean": 4.565750817799999,
      "stddev": 0.1319862166224547,
      "median": 4.574719013999999,
      "user": 1.8723732600000003,
      "system": 1.3918403,
      "min": 4.4142877105,
      "max": 4.7797681105,
      "times": [
        4.7797681105,
        4.4142877105,
        4.6509028435,
        4.5746579794999995,
        4.6523897325,
        4.709769243499999,
        4.4298635845,
        4.4373757685,
        4.4337131565,
        4.574780048499999
      ]
    },
    {
      "command": "pnpr@HEAD",
      "mean": 3.541947906,
      "stddev": 0.08236236843393557,
      "median": 3.5305198035,
      "user": 1.32478836,
      "system": 1.2112958,
      "min": 3.4583086805,
      "max": 3.6953778965,
      "times": [
        3.5192377805,
        3.5437660245,
        3.4714134645,
        3.5418018265,
        3.6953778965,
        3.5523539195000002,
        3.4703250315000003,
        3.4930617535,
        3.6738326825,
        3.4583086805
      ]
    },
    {
      "command": "pnpr@main",
      "mean": 3.560965735000001,
      "stddev": 0.12345233556014687,
      "median": 3.5237147235,
      "user": 1.3093808599999999,
      "system": 1.2385766999999999,
      "min": 3.4497645355,
      "max": 3.8631723175,
      "times": [
        3.5195971215,
        3.4497645355,
        3.4787872945,
        3.5278323255,
        3.5663458935,
        3.8631723175,
        3.6261764605,
        3.4626813835,
        3.6281628425,
        3.4871371755
      ]
    }
  ]
}

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13728
Testbedpacquet
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
🚷 view threshold
2,563.98 ms
(-4.27%)Baseline: 2,678.47 ms
3,214.16 ms
(79.77%)
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
🚷 view threshold
1,716.81 ms
(-3.48%)Baseline: 1,778.72 ms
2,134.47 ms
(80.43%)
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
🚷 view threshold
409.69 ms
(-10.00%)Baseline: 455.18 ms
546.22 ms
(75.00%)
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
🚷 view threshold
202.48 ms
(-8.71%)Baseline: 221.79 ms
266.15 ms
(76.08%)
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
🚷 view threshold
2,352.16 ms
(-3.92%)Baseline: 2,448.12 ms
2,937.74 ms
(80.07%)
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
🚷 view threshold
4,422.66 ms
(-2.35%)Baseline: 4,529.23 ms
5,435.08 ms
(81.37%)
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
🚷 view threshold
249.28 ms
(-13.12%)Baseline: 286.92 ms
344.31 ms
(72.40%)
isolated-linker.peer-heavy-resolve.hot-cache.offline📈 view plot
🚷 view threshold
559.91 ms
(-24.12%)Baseline: 737.86 ms
885.44 ms
(63.24%)
🐰 View full continuous benchmarking report in Bencher

@github-actions

github-actions Bot commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

🐰 Bencher Report

Projectpnpm's project
Branchpr/13728
Testbedpnpr

⚠️ WARNING: No Threshold found!

Without a Threshold, no Alerts will ever be generated.

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds flag.

Click to view all benchmark results
BenchmarkLatencymilliseconds (ms)
isolated-linker.fresh-install.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,428.93 ms
isolated-linker.fresh-install.cold-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
296.91 ms
isolated-linker.fresh-install.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
291.06 ms
isolated-linker.fresh-resolve.hot-cache.offline📈 view plot
⚠️ NO THRESHOLD
85.82 ms
isolated-linker.fresh-restore.cold-cache.cold-store📈 view plot
⚠️ NO THRESHOLD
1,368.04 ms
isolated-linker.fresh-restore.cold-cache.cold-store.cold-pnpr📈 view plot
⚠️ NO THRESHOLD
3,458.31 ms
isolated-linker.fresh-restore.hot-cache.hot-store📈 view plot
⚠️ NO THRESHOLD
258.32 ms
🐰 View full continuous benchmarking report in Bencher

zkochan and others added 2 commits August 8, 2026 13:33
…ry comparison

URL-equivalent spellings of the canonical npm registry (case variants, an
explicit :443) must not be misclassified as non-canonical, or the
fail-closed policy for the canonical registry would be bypassable through
ordinary user configuration. Both stacks now normalize through URL
parsing and share one comparison rule; the TS stack reuses the
equalRegistries helper from `@pnpm/deps.security.signatures`.

Also adds the direct TypeScript regression coverage for
stripRegistryTarballUrls that review asked for: mirror-hosted registry
tarballs persist integrity-only, while file:, git-hosted, and
subdirectory tarballs keep their URLs.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 8, 2026 11:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions github-actions Bot added the reviewed: coderabbit CodeRabbit submitted an approving review label Aug 8, 2026
@zkochan

zkochan commented Aug 8, 2026

Copy link
Copy Markdown
Member Author

Re the Qodo review:

  1. Canonical registry misdetected — fixed in cd338f1: both stacks normalize through URL parsing before comparing (lowercased host, default port dropped), with tests asserting https://Registry.NPMJS.org:443/ counts as canonical and fails closed.
  2. attemptSignatureVerification has 6 params — leaving as is: it is a private helper whose signature mirrors the pre-existing findSignatureFailure it was extracted from, and the surrounding module (including the exported verifyInstalledPackageSignatures) already passes trustedKeys/getAuthHeader/opts/packumentCache positionally. Introducing an options object for just this helper would diverge from the file's idiom without touching the exported API.
  3. Historical comment "written by an earlier pnpm" — leaving as is: these comments describe runtime input provenance, not this code's past shape. Lockfiles written by older pnpm releases exist in the wild (11.5.3+ persisted tarball-carrying entries before rejecting them), and that is precisely the contract the self-heal path exists to handle — without saying so, a reader cannot tell how an "invalid" entry could ever have been persisted.

Written by an agent (Claude Code, claude-fable-5).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts`:
- Around line 90-92: Update the resolution assertions in
resolvePackageManagerIntegrities to compare complete objects for git-hosted-dep
and subdir-dep, using their exact original tarball URLs and integrity values
rather than expect.any(String). Preserve the existing local-dep assertion and
ensure the expected values retain opaque URLs without normalization.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 39751623-a2da-4535-b9cb-8225d9b2fda6

📥 Commits

Reviewing files that changed from the base of the PR and between bdc4465 and 00b5342.

📒 Files selected for processing (6)
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs
  • pnpm11/deps/security/signatures/src/verifySignatures.ts
  • pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts
  • pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts
  • pnpm11/installing/env-installer/test/resolvePackageManagerIntegrities.test.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • pnpm11/engine/pm/commands/test/self-updater/verifyPnpmEngineIdentity.test.ts
  • pnpm11/engine/pm/commands/src/self-updater/verifyPnpmEngineIdentity.ts
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine.rs
  • pnpm/crates/cli/src/cli_args/self_update/verify_engine/tests.rs
  • pnpm11/deps/security/signatures/src/verifySignatures.ts

@qodo-code-review

Copy link
Copy Markdown

Code review by qodo was updated up to the latest commit 00b5342

Copilot AI review requested due to automatic review settings August 8, 2026 11:40
stuffbucket added a commit to stuffbucket/monimal that referenced this pull request Sep 7, 2026
…#75)

## Why the pin existed

`mise.toml` pinned pnpm not as a convenience but because **the
`packageManager`
field could not be satisfied here at all**. pnpm refused to switch to a
version
it could not verify, and the 1ES proxy publishes no npm registry
signatures — no
`dist.signatures`, no `/-/npm/v1/keys`, no attestations, only a SHA-1
`shasum`.
Keeping the pinned version already on PATH meant no switch was ever
attempted.

## That constraint is gone

pnpm 11.21.0 lifted it.
[pnpm/pnpm#13728](pnpm/pnpm#13728)
fixed both halves **against this exact proxy** — Microsoft filed it, and
the PR
names the shasum-only case directly. Package-manager entries are now
recorded
integrity-only (the bootstrap always derives the download URL from the
trusted
registries rather than from the lockfile), and the engine signature
falls back to
registry.npmjs.org when the configured registry cannot provide one.

Demonstrated both ways against this repo's `.npmrc`, in a scratch
project pinning
a different pnpm:

```
11.17.0   [ERROR] The packageManager dependency "[email protected]" in pnpm-lock.yaml
          must use a registry package path and an integrity-only resolution
11.25.0   switches and reports 11.23.0
```

The two versions stay equal anyway — a switch that works is still a
download
nobody asked for — but the comment no longer asserts a constraint that
has been
fixed.

## What this does *not* fix

**The lockfile tarball hosts.** Different code path, different
constraint: an
ordinary `--frozen-lockfile` install fetches the recorded URL *without
resolving*,
so pnpm cannot drop a URL it is unable to reconstruct — a frozen install
would
have nothing to fetch. Ours is unreconstructible on the host alone
(`ms-feed-N.pkgs.visualstudio.com` vs the registry host), so it is kept.

That asymmetry is why #13728 could drop the URL for the bootstrap and
not here.

`scripts/strip-lockfile-hosts.mjs` stays. Worth recording that it rests
on solid
ground — the registry-derived URL genuinely resolves:

```
https://packagefeedproxy.microsoft.io/npm/wrappy/-/wrappy-1.0.2.tgz
  → 303 → signed blob → 1676 bytes, sha1 b5243d8f… (matches the advertised shasum)
```

The one supported alternative, `trustLockfile`, is **worse on both
axes**: it
keeps the URLs (so every install still churns ~1700 lines) *and* gives
up the
anti-tamper binding that
[#12134](pnpm/pnpm#12134) added.
Stripping leaves no URL to tamper with at all.

## Verification

- Lockfile **byte-identical** under 11.25.0; format version unchanged at
`9.0`.
- `verify:workspace` passes (14 assertions).
- Container suite **15/15**, with `pnpm v11.25.0` inside.
- `mise.lock` carries the `linux-x64` and `linux-arm64` checksums the
Docker
  build reads (`scripts/docker-test.mjs` cross-checks it against
  `packageManager`).

## One transition cost

For anyone not on mise: **a local pnpm older than 11.21.0 now fails on
entry to
this repo**, because it tries to switch to 11.25.0 and hits the very bug
above.
`mise install` resolves it. CI is unaffected — `pnpm/action-setup`
installs the
pinned version directly and never switches.

## Do not jump to pnpm 12

It is the Rust rewrite, and there is an open issue about it refusing
integrity-less tarball resolutions — which is exactly what this
shasum-only proxy
serves.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product: pacquet product: pnpm@11 reviewed: coderabbit CodeRabbit submitted an approving review

Projects

None yet

3 participants