Reject database URLs carrying embedded credentials at the proxy boundary - #2250
Merged
kmcginnes merged 0 commit intoSep 23, 2026
Conversation
kmcginnes
added this pull request to stack #2253
September 23, 2026 21:40
kmcginnes
force-pushed
the
redact-connection-url-in-proxy-logs
branch
from
September 23, 2026 22:14
20853d5 to
ca5fb65
Compare
kmcginnes
marked this pull request as ready for review
September 23, 2026 22:23
kmcginnes
force-pushed
the
redact-connection-url-in-proxy-logs
branch
from
September 23, 2026 23:36
ca5fb65 to
123c552
Compare
5 tasks
Collaborator
Author
|
Closed by GitHub, not merged. A stack reorder moved this branch underneath Nothing here reached |
kmcginnes
added a commit
that referenced
this pull request
Sep 23, 2026
…ary (#2255) ## Description A database URL carrying a username or password passed the proxy server's request validation, even though `node-fetch` refuses to build a request from such a URL. That connection has never been able to run a query, so the only outcome was a failure further along with a less useful message. Validation now rejects a database URL with userinfo, which turns it into a 400 before any `URL` object is built from it. Nothing that used to work stops working. Header values included in the log line for a failed request are also normalised to drop any userinfo. ## Validation All six database routes return 400 for such a URL and dispatch no outbound fetch. A URL carrying only a username is rejected too, and a URL without userinfo still proxies normally. The log-line tests cover a URL value, a URL without userinfo, a value that is not a URL at all, and a value outside the allowed list. `pnpm checks` and `pnpm test` clean: 223 files, 2720 tests. ## Notes This replaces #2250, which GitHub closed as merged when a stack reorder made its head commit an ancestor of its own base branch. Nothing from it reached `main`. Same commit, rebased directly onto `main`, and independent of any other open PR. ## Related Issues None. ### Check List - [x] I confirm that my contribution is made under the terms of the Apache 2.0 license. - [x] I have verified `pnpm checks` passes with no errors. - [x] I have verified `pnpm test` passes with no failures. - [x] I have covered new added functionality with unit tests if necessary. - [x] I have updated documentation if necessary.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A database URL carrying a username or password passed the proxy server's request validation, even though
node-fetchrefuses to build a request from such a URL. That connection has never been able to run a query, so the only outcome was a failure further along with a less useful message.Validation now rejects a database URL with userinfo, which turns it into a 400 before any
URLobject is built from it. Nothing that used to work stops working.Header values included in the log line for a failed request are also normalised to drop any userinfo.
Validation
All six database routes return 400 for such a URL and dispatch no outbound fetch. A URL carrying only a username is rejected too, and a URL without userinfo still proxies normally. The log-line tests cover a URL value, a URL without userinfo, a value that is not a URL at all, and a value outside the allowed list.
pnpm checksandpnpm testclean: 223 files, 2733 tests.Related Issues
None.
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.