Skip to content

fix(npm): bound postinstall redirects - #911

Merged
nc9 merged 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/postinstall-redirect-cap-213
Oct 17, 2026
Merged

nc9 merged 2 commits into
squirrelscan:mainfrom
WilliamK112:codex/postinstall-redirect-cap-213

Conversation

@WilliamK112

Copy link
Copy Markdown
Contributor

Summary

  • cap postinstall downloads at three followed redirects
  • reject non-HTTPS and malformed redirect targets explicitly
  • resolve relative Location headers against the current URL

Testing

  • bun test npm/scripts/postinstall.test.ts (6 passed)
  • node --check npm/scripts/postinstall.js

Closes #213

@WilliamK112
WilliamK112 requested a review from nc9 as a code owner October 17, 2026 05:20
@nc9
nc9 merged commit 75a8521 into squirrelscan:main Oct 17, 2026
15 checks passed
@nc9

nc9 commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Merged, thanks @WilliamK112! The postinstall download now stops after three redirects, sticks to HTTPS, and handles a relative Location properly. Good hardening for anyone installing from npm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(npm): cap redirect following in the npm postinstall downloader

2 participants