New
Introducing React Bench, see how different models perform on React code

react-doctor/require-pnpm-hardening

pnpm project is missing supply-chain hardening in pnpm-workspace.yaml: set `minimumReleaseAge`, keep `blockExoticSubdeps: true`, and set `trustPolicy: no-downgrade`

Status
Active
Category
Security
Assessment
Evidence-required risk
Required evidence
source code, repository context
Default severity
warn
Show technical metadata
Scope
All supported frameworks
Active when
always (pnpm-managed project)
Priority
58 (P2)
Source
react-doctor-core
Rule set
oxlint-plugin-react-doctor 0.9.3 (prompt schema 2)
On this page

Validation prompt

Confirm the detector match and collect the required evidence before deciding whether an edit is warranted.

Project-level supply-chain check that fires on pnpm-managed repos (detected via pnpm-lock.yaml, pnpm-workspace.yaml, or a "packageManager": "pnpm@…" field) and emits one diagnostic per weak setting in pnpm-workspace.yaml: (1) minimumReleaseAge absent, (2) blockExoticSubdeps: false, or (3) trustPolicy absent or set to anything other than no-downgrade. Each is a genuine registry-side exposure, so CONFIRM on any project that installs third-party packages. SUPPRESS only when equivalent hardening is enforced where the per-file YAML parser can't see it: an org-wide .npmrc / registry proxy or private mirror that already delays and vets releases and pins trust: or for a documented throwaway/sandbox repo where the supply-chain surface is intentionally accepted. Note the check reads the literal YAML values, so a setting injected dynamically (CI overlay, generated workspace file) may need manual confirmation.

Evidence boundary

The diagnostic proves only that the detector’s modeled source pattern matched. It does not prove runtime impact, product intent, rendered failure, or that one remediation is correct.

Establish the environment, repository policy, exceptions, and required rendered or runtime evidence before deciding the occurrence.

Record one outcome:

  • Confirmed failure: The required evidence establishes the violation.
  • Rejected: A documented exception or false-positive predicate applies.
  • Needs evidence: Named evidence can still be collected.
  • Unavailable: Required evidence cannot be collected in this run.
  • Waived with evidence: An authorized, scoped exception applies to an established failure.
  • Observation: The review records an optional tradeoff without claiming a defect.

A waiver records its scope, authority, evidence, and review condition. It is not a pass or false positive.

Default severity is registry metadata. Use the occurrence’s JSON severity after repository configuration when ordering real findings.

Fix prompt

Apply this candidate correction only after the required evidence confirms the risk.

Add the missing keys to pnpm-workspace.yaml and re-lock with pnpm install: set minimumReleaseAge: 10080 (7 days) so freshly published: and quickly-unpublished-malware: versions aren't installed the moment they land; set trustPolicy: no-downgrade so pnpm refuses packages whose provenance/signature trust weakens between resolutions; and leave blockExoticSubdeps: true (the recent-pnpm default): never set it to false, which lets transitive deps come from git:/file:/tarball URLs that bypass the registry. These narrow the window and surface for supply-chain attacks without changing your dependency set. See https://pnpm.io/settings

Repository-wide copy prompt

Use this repository-wide prompt only after validating each occurrence. For one occurrence, use the guidance above.

Show repository-wide prompt

Fix every confirmed react-doctor/require-pnpm-hardening diagnostic in the current repository.

Required change:

  • Add the missing keys to pnpm-workspace.yaml and re-lock with pnpm install: set minimumReleaseAge: 10080 (7 days) so freshly published: and quickly-unpublished-malware: versions aren't installed the moment they land; set trustPolicy: no-downgrade so pnpm refuses packages whose provenance/signature trust weakens between resolutions; and leave blockExoticSubdeps: true (the recent-pnpm default): never set it to false, which lets transitive deps come from git:/file:/tarball URLs that bypass the registry. These narrow the window and surface for supply-chain attacks without changing your dependency set. See https://pnpm.io/settings

Validation before editing:

Project-level supply-chain check that fires on pnpm-managed repos (detected via pnpm-lock.yaml, pnpm-workspace.yaml, or a "packageManager": "pnpm@…" field) and emits one diagnostic per weak setting in pnpm-workspace.yaml: (1) minimumReleaseAge absent, (2) blockExoticSubdeps: false, or (3) trustPolicy absent or set to anything other than no-downgrade. Each is a genuine registry-side exposure, so CONFIRM on any project that installs third-party packages. SUPPRESS only when equivalent hardening is enforced where the per-file YAML parser can't see it: an org-wide .npmrc / registry proxy or private mirror that already delays and vets releases and pins trust: or for a documented throwaway/sandbox repo where the supply-chain surface is intentionally accepted. Note the check reads the literal YAML values, so a setting injected dynamically (CI overlay, generated workspace file) may need manual confirmation.

Constraints:

  • Confirm every occurrence independently.
  • Make the smallest change that addresses the root cause.
  • Preserve unrelated behavior, interfaces, content, and semantics.
  • Reuse existing project conventions and components.
  • Do not suppress the rule merely to clear the report.

Assessment:

  • Record detector evidence, applicability, missing evidence, and one outcome: Confirmed failure, Rejected, Needs evidence, Unavailable, Waived with evidence, or Observation.

Verification:

  • Run focused tests and every repository-mandated check.
  • Run React Doctor and confirm the diagnostic no longer appears from changed code.
  • Run an unfiltered scan of the affected scope before claiming no cross-category regression.
  • Report checks that were not run instead of claiming they passed.