ReviewOS

pantry-pm/pantry

security(registry): enforce persistent dual-use content metadata and DISCLOSURE

#221
Closed chrisbbreuer opened this 24 days ago · 0 comments
24 days ago

Goal

Support npm-style dual-use declarations so legitimate security tooling can explain security-relevant behavior without bypassing malware controls.

Reference: https://github.blog/changelog/2026-07-28-npm-publish-time-malware-scanning-and-dual-use-metadata/

Policy

  • Accept a bounded contentPolicy declaration in package metadata.
  • A declared package must include a root DISCLOSURE text file in the actual uploaded archive.
  • Reject binary, oversized, missing, nested-only, or empty disclosures.
  • Once any semantic version of a package declares dual-use content, future versions must retain both contentPolicy and the root disclosure.
  • Declaration does not force a clean verdict and does not permit malware.
  • Persist the declaration and disclosure digest/size, not disclosure text, in public metadata.
  • Require a strongly authenticated publication method when auth provenance can distinguish it; reject known bypass-2FA/direct-token methods. Document current Pantry auth limitations and the rollout path.

Acceptance criteria

  • Archive inspection handles npm package/DISCLOSURE roots and rejects traversal/ambiguous duplicate paths.
  • Tests cover valid text, missing/empty/binary/oversized/nested disclosures.
  • Tests prove declaration persistence across versions.
  • Existing non-dual-use packages continue to publish.
  • Documentation gives maintainers a concrete package.json and DISCLOSURE example.

Sign in to comment on this issue.