Harden web fetch against DNS rebinding#322
Merged
Merged
Conversation
oratis
marked this pull request as ready for review
July 26, 2026 07:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Security properties
Agentandfetch, with Happy Eyeballs disabled so it cannot resolve a second, unvalidated addressTradeoff
Strict fail-closed handling rejects VPN/TUN DNS modes that synthesize public hostnames into the reserved
198.18.0.0/15benchmark range (for example Clash fake-IP mode). That is intentional for the secure default: allowing the range would re-open access to locally routed reserved addresses. Operators using fake-IP DNS should use a real-IP/redir-host mode for LISA's web fetch path.Validation
npm run typechecknode --import tsx --test src/tools/web_fetch.test.ts(44 pass)npm test(1477 pass, 1 environment skip, 0 fail)npm run build198.18.0.0/15, confirming the fail-closed redirect pathStack
Depends on #321. Review commit
a2f10bbonly.