Skip to content

fix: nightly hardening - redirect-safe remote profile loading - #10

Open
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260420-redirect-guard
Open

fix: nightly hardening - redirect-safe remote profile loading#10
mouse-value-add wants to merge 1 commit into
mainfrom
chore/nightly-hardening-20260420-redirect-guard

Conversation

@mouse-value-add

@mouse-value-add mouse-value-add commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

loadFromUrl validated the initial URL as HTTPS, but fetch still allowed redirects by default. A hostile endpoint could redirect to a different destination, weakening the trust boundary for remote profile loading.

Approach

  • Set redirect: "error" on remote profile fetches to fail closed on redirects.
  • Added explicit redirect error mapping to a clear NETWORK_ERROR message.
  • Added tests to verify redirect mode is enforced and redirect failures are handled cleanly.

Verification

  • npm test -- test/parser/loadFromUrl.test.ts
  • npm test
  • Result: 17 files, 144 tests passed.

Risks

  • URLs that intentionally rely on redirects (for example short links) now fail instead of being followed.

Rollback plan

  • Revert commit 4c86579 to restore prior redirect-following behavior.
  • Or remove redirect: "error" while keeping the rest of the hardening changes.

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.

1 participant