You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
chore: SSRF test sweep — migrate .example hostname fixtures so #381 can land #544
#381 asks for validateExternalUrl to fail closed when both dns.resolve4 and dns.resolve6 return empty arrays. Attempted today (branch issue-381-ssrf-empty-dns-fail-closed, reverted before push).
The 3-line production change is straightforward. The problem: ~10 existing tests bake .example hostnames (alice.example, melvin.example, etc.) past the validator because the current fail-open lets them through. After fail-closed lands, those tests break with:
SSRF protection: Hostname alice.example has no A/AAAA records
Affected test files identified so far (non-exhaustive):
test/keys-provision-lws-cid.test.js
test/nostr-cid-vm.test.js
(Plus likely others — full count emerged from npm test after the patch.)
Scope
For each affected test, pick one of:
Override DNS via a test seam. A small _dns parameter on validateExternalUrl (mirroring the _validateUrl precedent at src/auth/did-nostr.js:97 — "test seam; production callers MUST NOT override") lets the test supply a stub that returns a known IP for *.example. Most surgical, no fixture change.
Migrate to IP literals. Replace alice.example with 127.0.0.1 or similar in the fixture. Cleaner, but requires re-examining each test's assertions about WebIDs / origins / etc.
Recommendation: option 1 for tests that ARE testing SSRF-adjacent behavior; option 2 for tests where the fake hostname is incidental.
Activity