Skip to content

Commit b978e15

Browse files
arvclaude
andauthored
ci: harden .npmrc (release-age cooldown + block git-URL deps) (#29)
* ci: add 7-day npm release-age cooldown (.npmrc min-release-age) npm has no default cooldown (unlike pnpm@11). Set min-release-age=7 so resolution only picks versions published >=7 days ago, giving time for malicious releases to be caught/yanked before install. CI already uses --ignore-scripts and package-lock=false, so this gates every resolve. Per the TanStack/Snyk supply-chain advisory. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * ci: block git-URL deps (.npmrc allow-git=none) Git dependencies can ship a .npmrc that overrides the git executable path, enabling arbitrary code execution at install (the actual TanStack attack vector). npm CLI 11.10+ supports allow-git=none, and v12 is expected to make it the default. No current dep uses a git URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 01a5209 commit b978e15

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.npmrc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
11
package-lock=false
2+
3+
# Supply-chain hardening: only install npm versions published >=7 days ago,
4+
# so freshly-compromised releases are likely caught/yanked before we pull them.
5+
# https://snyk.io/blog/tanstack-npm-packages-compromised/
6+
min-release-age=7
7+
8+
# Block git-URL dependencies entirely (npm CLI v11.10+). Git deps can ship
9+
# their own .npmrc and override the git executable path, enabling arbitrary
10+
# code execution during install (the actual TanStack attack vector). No
11+
# current dep needs this and npm v12 is expected to make none the default.
12+
allow-git=none

0 commit comments

Comments
 (0)