fix(registry): case-fold + trim-dot in isPlatformTunnelHostname (#2425 follow-up) #2429
Reference in New Issue
Block a user
Delete Branch "fix/platform-tunnel-hostname-normalize"
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?
Security-review follow-up to #2425 (the cross-cloud register fix). The auditor found two availability bugs: url.Hostname() doesn't lowercase and keeps a trailing dot, so WS-...MOLECULESAI.APP and FQDN-form ws-x.moleculesai.app. would be blocked at register. Fix: case-fold + trim trailing dot before the prefix/suffix match (DNS is case-insensitive). Fails closed unchanged for non-platform hosts; adds uppercase/trailing-dot/parent-domain test cases. Generated with Claude Code
APPROVED — agent-reviewer 5-axis (head
2371b06f) · 1st distinct.Scope:
isPlatformTunnelHostnamenow normalizes the hostname —strings.ToLower(strings.TrimSuffix(h, "."))— and lowercases MOLECULE_APP_DOMAIN before thews-prefix + platform-domain allowlist check.net/urlHostname() doesnt lowercase and keeps the FQDN trailing dot, soWS-…MOLECULESAI.APP/ws-x.moleculesai.app.were false-negatives getting blocked (the exact availability bug this allowance cures). Folding case + trailing dot on both sides fixes it.ws-x.fakemoleculesai.app→ false (lookalike) andws-x.moleculesai.app.attacker.com→ false (parent-domain/right-extension trick). So normalization fixes false-negatives without introducing a bypass — security-neutral-to-positive.CI fully green (Platform-Go ✅, all-required ✅, E2E API Smoke ✅, Handlers-PG ✅, sop ✅). Note: mergeable=false → needs a rebase before it can land (the 2nd-distinct reviewer can confirm on the rebased head). Clean approve.
2371b06fd1toab7aadd7faNew commits pushed, approval review dismissed automatically according to repository settings
Approved on head
ab7aadd7fa.5-axis review:
ws-prefix and.+ domain suffix boundary.MOLECULE_APP_DOMAINis also lowercased and trailing-dot normalized.Verification note: local Go test execution is unavailable in this runtime because
gois not installed; static review found no blocker.