Skip to content

fix: pin validated DNS addresses - #5

Merged
fly1d merged 1 commit into
mainfrom
fix/dns-rebinding
Aug 11, 2026
Merged

fix: pin validated DNS addresses#5
fly1d merged 1 commit into
mainfrom
fix/dns-rebinding

Conversation

@fly1d

@fly1d fly1d commented Aug 11, 2026

Copy link
Copy Markdown
Owner

What changed

  • Move URL validation and fetching into a focused, directly testable module.
  • Replace the second untrusted DNS lookup with a native HTTP/HTTPS connection pinned to the previously validated addresses.
  • Resolve and pin every redirect destination independently, then verify the actual connected socket remains public.
  • Add no-network regression tests for DNS rebinding, redirects, mixed DNS answers, socket validation, and address boundaries.

Closes #4

Risk

  • Low: copy, styles, documentation, or isolated cleanup
  • Medium: interaction, API response, or shared behavior
  • High: fetching, security boundary, deployment, or data compatibility

Verification

  • npm run ci passes locally
  • I tested the main user path affected by this change
  • I checked desktop/mobile layout when UI changed
  • I added or updated tests for behavior changes
  • I documented anything intentionally not tested

Verification notes:

All 11 local checks pass. A real fetch of https://example.com/ also succeeded with TLS hostname validation, a 559-byte body, and the expected title. UI layout is unchanged.

Review and release

  • The diff is focused and contains no unrelated changes
  • Error, empty, loading, and recovery states were considered
  • Security and privacy impact was considered
  • Rollback is understood

Rollback plan:

Revert this PR. No data migration or dependency change is involved.

@fly1d fly1d left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review completed with no blocking findings. Verified: validated DNS answers are passed into the native connection lookup; redirect hosts are independently resolved and pinned; the connected socket address is checked; public IPv4/IPv6 boundaries remain allowed; no dependency was added; all 11 tests and the real HTTPS fetch pass.

@fly1d
fly1d merged commit 9c041a7 into main Aug 11, 2026
1 check passed
@fly1d
fly1d deleted the fix/dns-rebinding branch August 11, 2026 09:57
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.

security: pin validated DNS addresses during URL fetch

1 participant