chore(ui): add pnpm supply chain security protections#10471
chore(ui): add pnpm supply chain security protections#10471pfe-nazaries wants to merge 8 commits intomasterfrom
Conversation
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
|
Please add an entry to the corresponding |
🔒 Container Security ScanImage: ✅ No Vulnerabilities DetectedThe container image passed all security checks. No known CVEs were found.📋 Resources:
|
514be55
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
Clean, well-scoped security hardening. The layered approach (release age + build allowlist + trust policy + exotic subdep blocking) is solid, and pinning pnpm via packageManager + package_json_file in CI is the right fix — floating version: 10 was quietly defeating the SHA512 pin.
One thing worth a follow-up (not blocking): the onlyBuiltDependencies allowlist has @heroui/shared-utils and msw — both feel unusual for needing postinstall scripts. Worth confirming those are actually required, not just leftover from a previous audit.
Ship it.
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
Quick question on the onlyBuiltDependencies allowlist: @heroui/shared-utils and msw look unusual at first glance. Do you know why those two need postinstall scripts?
Good point there. I will take a look at heroui (i think we can remove it). Msw is expected to be there |
Apparently, HeroUI needs to inject different scripts depending on the React and Next.js version during build time. This is annoying from their side but necessary until we get rid of HeroUI |
There was a problem hiding this comment.
Three things to fix before merge:
-
The builder stage doesn't use the pinned pnpm.
corepack installruns indeps, butbuilderinherits frombase— which after this PR only hascorepack enable. Sopnpm run buildresolves pnpm from corepack's base shim, not thepackage.jsonpin. Version pinning breaks at the build stage. -
onlyBuiltDependencieshas entries that don't belong.mswisn't independenciesordevDependencies— dead entry. For the transitive ones (@heroui/shared-utils,unrs-resolver,@sentry/cli), add a comment per entry explaining why it needs a build script. I verified@heroui/shared-utilsis legit (detects React/Next version, copies demi bundles), but the others aren't obvious from the code alone. -
No escape hatch for emergency patches.
minimumReleaseAge: 1440blocks packages published in the last 24h — including critical CVE patches. If a zero-day drops innextorreact, the team can't install the fix until the next day. AddminimumReleaseAgeExcludewith at least the most critical packages.
191ddab to
f01f86d
Compare
f01f86d to
0b87c5f
Compare

Summary
pnpm-workspace.yamlwith layered supply chain protectionsper https://pnpm.io/supply-chain-security
blockExoticSubdepsandtrustPolicy)ui/package.jsoninstead of floatingversion: 10Supply chain protections added
minimumReleaseAge: 1440onlyBuiltDependenciestrustPolicy: no-downgradeblockExoticSubdeps: trueCI fix
pnpm/action-setupwas configured withversion: 10, whichinstalls the latest 10.x ignoring the pinned version in
packageManager. Sincepackage.jsonlives inui/(not reporoot), the action never found it. Now uses
package_json_file: ui/package.jsonto read the exact SHA512-verified version.Test plan
rm -rf node_modules && pnpm install) — notrust violations or exotic subdep issues
package_json_file: ui/package.json