Networking: test anchors for un-pinned architectural properties (SSRF rebinding, Connection: close, happy-path TLS) #483
Labels
No labels
bug
dependencies
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
refactor
rust
technical-debt
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
navicore/patch-seq#483
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Networking — test anchors for un-pinned architectural properties
Three test gaps from the PR1–PR5 reviews where the property holds in current code but no test would catch a regression. Reviewers flagged these as "deferrable but worth pinning" or "the strongest security win of the design with no test anchoring it."
Items
SSRF DNS-rebinding-closure regression test (deferred from PR4 #480)
Approach: add a
#[cfg(test)]injection point indns::resolvethat returns scripted responses on successive calls. Test mocks the resolver to return a safe IP on the first call (which the SSRF check accepts) and a dangerous IP (e.g.127.0.0.1) on the second. Then issue a request and assert that the dial went to the first IP — the validated one — not the second. A regression that passeshost: Stringto connect and re-resolves there would fail this test loudly. Small.Connection: closepool-eviction test (deferred from PR4 #480)Today's integration test server (
http_client/integration_tests.rs::spawn_test_server) only emitsConnection: keep-alive. Would catch a future regression where the response'skeep_alive=falseis silently ignored on the pool release path.Approach: add a
CloseOncevariant toServerModethat emitsConnection: closeand closes the socket after one response. Test issues two requests to the same host and assertsaccept_count == 2(proving the pool didn't try to reuse a doomed entry). ~15 lines on top of the existingServerModeenum. Small.Happy-path TLS integration test with same-process rustls server (deferred from PR3 #479)
PR4's HTTPS coverage exercises real-world TLS implicitly (manual verification against
https://example.com), but a hermetic test against a same-process rustls server with a fixture self-signed cert + customRootCertStorewould pin the handshake-shape against rustls upgrades. Needs:tests/fixtures/or generated at test time.cfg(test)path that lets the runtime use a non-defaultRootCertStore(custom CA) instead ofwebpki-roots.Medium.
Rough scope
One day. One PR. Mostly test code; the only production change is whatever harness needs to land for the rebinding test (probably a
#[cfg(test)]injection point indns::resolve) and thecfg(test)trust-root override for the TLS happy-path test.#487