Repository navigation
fix(migrations): apply the outbound host policy to migration sources - #14870
Conversation
Migration sources (the worker, and the Appwrite, Supabase and NHost report routes) now apply the PublicHostname destination policy on every connection, the same one webhooks and OAuth use, via a new PublicHostname::getDestinations(). An Appwrite source on this deployment's own hosts keeps its existing local-endpoint trust. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
🧹 Nitpicks (3) — 🟢 3 low
This PR hardens migration source connections against DNS rebinding by wiring
Note: two correctness scan producers failed to publish artifacts; their coverage (deployment-host exemption logic) was instead adjudicated via the security and domain scans. Reviewed commit: f6f993d |
🟢 Tier S · Ready to merge
Migration source connections now apply the public-host destination policy across the worker and the Appwrite, Supabase, and NHost report routes, while preserving trust for configured deployment hosts. The PR adds deployment-host validation and coverage for private deployment destinations and DNS rebinding. Latest changes: The latest test update accepts an existing proxy rule for the private test hostname and only deletes the rule when this run created it.
📂 Walkthrough · 12
Reviewed the commits since |
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
There was a problem hiding this comment.
Adds DNS-rebinding protections to migration sources by pinning connections to validated destinations, with e2e coverage and test DNS fixtures.
Key findings
- 🟡 Deployment-host exemption is dead for internal hosts and strips rebinding pinning — Get.php:81
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
…and the worker The report and create routes ran the public address check before the deployment host exemption, so an internal _APP_MIGRATION_HOST or a subdomain of _APP_DOMAIN at a private address was refused there while the worker accepted it. Check deployment hosts first in all three, and keep holding every other host to the checked addresses on each connection. The deployment hosts move into a DeploymentHostname validator shared by the routes and the worker, which also reads a scheme-qualified _APP_MIGRATION_HOST or _APP_DOMAIN by its host instead of misparsing it. The rebinding test now pins the worker's refusal to the aborted connection rather than any failure. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… network The test connected back to the API through the docker host, which Linux runners do not route for a container on a user-defined network. The API now has a fixed address on the appwrite network and the fixture host points at it, so the host check still sees the fixture's private address while the connection stays inside the network. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI enables router protection, which only serves the API on platform hostnames and connected API domains, so the source refused the test's requests. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ment host Co-Authored-By: Claude Opus 5.5 <[email protected]>
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…(backport #14870) 1.9.x already pins Appwrite sources to checked public addresses through the migration library's resolver. This applies the same resolver to the Supabase and NHost sources and connects to the checked address of the Supabase database host, which 1.9.x did not check at all. The deployment host trust and its DNS fixture test are not ported. (cherry picked from commit 6d258d2)
…d-policy fix(migrations): apply the outbound host policy to migration sources (cherry picked from commit 6d258d2)
What does this PR do?
Migration sources (the worker, and the Appwrite, Supabase and NHost report routes) now apply the PublicHostname destination policy on every connection, the same one webhooks and OAuth use, via a new PublicHostname::getDestinations(). An Appwrite source on this deployment's own hosts keeps its existing local-endpoint trust.
Test Plan
New e2e test using a DNS fixture (tests/resources/dns/zones.conf, extra_hosts in docker-compose.override.yml). Migrations e2e 81/81, tests/unit/Network 84/84. Lint and PHPStan are clean.
Related PRs and Issues
Checklist
🤖 Generated with Claude Code