Repository navigation
fix(signal): return 400 for an IPv6 zone-id Host - #336
Conversation
A Host value such as [::1%lo0] is an IPv6 address to isIP, and new URL throws on the zone id inside the request listener. Treat that host as disallowed so the process stays up and answers 400. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed October 7, 2026, 2:27 AM ET / 06:27 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch rejects Signal IPv6 zone-ID Host headers with HTTP 400, adds three continued-service regression cases and documentation, and incorporates the already-merged shared autoreview tooling update. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main and v0.1.29 retain the uncaught Host conversion. No blocking patch defect was found, and the previously accepted real TCP proof remains relevant. Priority: P2 Review scores
Verification
How this fits togetherCrabline’s Signal server emulates the signal-cli HTTP daemon for compatible clients. Host validation runs before requests reach health checks, event streams, messaging, or authenticated test-control routes. flowchart TD
A[HTTP client request] --> B[Normalize Host]
B --> C{Valid allowed host?}
C -->|No| D[HTTP 400]
C -->|Yes| E[Signal HTTP routes]
E --> F[Provider response]
D --> G[Server continues serving]
F --> G
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep malformed Host input within the existing HTTP 400 path while preserving valid-host handling and continued server availability. Do we have a high-confidence way to reproduce the issue? Yes: a raw HTTP request with Host [::1%lo0] reaches main’s unguarded IPv6 URL conversion before the route error handler. This review established the path from source and did not execute the server. Is this the best way to solve the issue? Yes: rejecting zone IDs and containing URL conversion failures repairs the existing validation boundary without introducing a competing route or configuration mode. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 45eb01541f6e. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
* chore(autoreview): use the shared canonical skill * docs(autoreview): preserve repository review priority
Complete the Host normalization fix with encoded and IPv4-mapped zone-ID regression coverage, a successful follow-up health check, setup documentation, and an Unreleased entry. Co-authored-by: Sebastien Tardif <sebtardif@ncf.ca>
What Problem This Solves
A Signal request with an IPv6 zone ID in its Host header, such as
[::1%lo0], could throw from the HTTP listener and terminate the server.User Impact
Malformed zone-ID Hosts now receive HTTP 400, and subsequent health checks still succeed. Ordinary IPv4, IPv6, and DNS Hosts retain their existing behavior.
Why This Change Was Made
Node's IP parser accepts scoped IPv6 addresses that WHATWG URL rejects. Host normalization now rejects zone IDs before canonicalization and contains URL parsing failures. This completes @SebTardif's fix with raw, encoded, and IPv4-mapped zone-ID coverage, setup documentation, and an Unreleased entry.
Evidence
The original raw-TCP regression failed against the base with an uncaught
ERR_INVALID_URL. The candidate passed all 44 Signal tests andpnpm verifyon Linux/Node 24: 2,000 tests passed, 69 skipped, and coverage thresholds passed. Independent Codex review covers P0–P3. GitHub CI also checks Node 22 and Node 24.Exact-head CI: https://github.com/openclaw/crabline/actions/runs/37581244203 (attempt 2). The first Node 24 attempt timed out in the unchanged Telegram readiness rollback test; the single failed-job retry passed. Node 22 and CodeQL passed as well.