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
codedb-bridge: parseDaemonUrl silently drops query, fragment and userinfo — CODEDB_DAEMON_URL validation rejects paths but strips the rest instead of failing fast #4198
parseDaemonUrl in bin/codedb-bridge.mjs:37-51 is meant to accept only a bare http:// origin — it rejects a non-URL, a non-http: protocol, and any path other than /:
if(url.protocol!=='http:'||(url.pathname!=='/'&&url.pathname!=='')){thrownewError(`CODEDB_DAEMON_URL="${value}" must be an http:// origin with no path ...`);}returnurl.origin;
But it never inspects url.search, url.hash, or url.username/url.password, and url.origin silently strips all three. So configuration the operator wrote is silently discarded instead of either honoured or rejected:
Laptop probe ~/git/fleet/probe-2026-11-01-laneA-codedb/ (verbatim copy of bin/codedb-bridge.mjs from main 199a7d27, md5 ca05ede20d2ae1a4760297bbe9320c58, node v24.21.0), calling parseDaemonUrl directly: all four inputs above returned "http://127.0.0.1:7719" with no error.
Controls in the existing suite (bin/codedb-bridge.test.mjs:16-24) confirm the intended strictness for the cases that are checked: https://… throws, http://127.0.0.1:7719/explore throws, a non-URL throws. Query/fragment/userinfo are simply untested and unchecked.
Why it matters
This is the bridge's only configuration knob, and its errors are supposed to fail fast at startup with a message naming the bad value (that is the whole design of parseDaemonUrl, and main exits 1 on its throw, :245-250). A typo'd or pasted URL carrying a query or credentials instead starts the bridge against a different effective configuration than the operator wrote, with no trace — a silent third path of the kind issue #3352 bans, at the config layer. Dropping embedded credentials silently is the worst case: the operator believes the daemon is being reached with auth; it is not, and nothing says so.
Acceptance criteria
parseDaemonUrl rejects (with the existing error style naming the value) any URL with a non-empty query string, fragment, username, or password — or, if one of those is deliberately supported, it is honoured and documented in the header instead of stripped.
Tests in bin/codedb-bridge.test.mjs cover query, fragment, and userinfo inputs alongside the existing protocol/path cases; the default and trailing-slash cases still pass.
Activity
dezren39 commentedon Nov 2, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
1 remaining item
dezren39 commentedon Nov 2, 2026
🤖 Agent note · picked up
Merge pull request #4199 from developing-today/queue/6090-4198-parse-…
dezren39 commentedon Nov 2, 2026
🤖 Agent note · done