Repository navigation
Conversation
The previous default allowed localhost, 127.0.0.1 and 0.0.0.0 to serve DID documents over plain HTTP. Because getDidResolver() is a library entrypoint, that default silently applied to any production service that called it without explicit webOptions, opening DID documents to MITM substitution on non-TLS networks. Change the default to an empty list (HTTPS-only) and update all demos and examples to pass their own allowedHttpHosts explicitly, so local development continues to work without polluting the library default.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (11)
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review. WalkthroughThe shared DID resolver now denies HTTP resolution by default. Demo and example callers explicitly allow HTTP resolution for ChangesDID Resolver HTTP Policy
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to The DID resolver now uses HTTPS by default, and demos and examples explicitly opt in to HTTP for local hosts. Callers that relied on the old implicit localhost HTTP default must now configure allowedHttpHosts. No merge-blocking risk was found. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing: this is a design choice, not a bug. The localhost default is intentional for developer convenience and consistent with web-did-resolver's own defaults. |
Problem
getDidResolver()ships with a default that allowslocalhost,127.0.0.1and0.0.0.0to serve DID documents over plain HTTP:Because this is a library entrypoint, the default silently applies to any production service that calls
getDidResolver()without explicitwebOptions. A DID document served over plain HTTP is vulnerable to man-in-the-middle substitution: an attacker on the network can swap the document (and its public keys) before it reaches the resolver, bypassing every downstream signature and issuer check.Fix
Change the default
allowedHttpHoststo[](HTTPS-only). This is the safe default for a library: production callers get HTTPS-only resolution without having to opt in.All demos and examples that resolve
did:webURIs against localhost are updated to passallowedHttpHostsexplicitly, so local development is unaffected.Migration
If you call
getDidResolver()in a local development or test environment that uses HTTP, pass the hosts explicitly:Production callers that already use HTTPS require no change.
Summary by CodeRabbit
localhost,127.0.0.1, and0.0.0.0. HTTP connections may be vulnerable to interception.