Skip to content

DSN Secret Leak Fix - #354

Open
walsykerem wants to merge 3 commits into
ClickHouse:mainfrom
walsykerem:dsn-secret-problem
Open

walsykerem wants to merge 3 commits into
ClickHouse:mainfrom
walsykerem:dsn-secret-problem

Conversation

@walsykerem

@walsykerem walsykerem commented Nov 25, 2026 •

Copy link
Copy Markdown

DSN Secret Leak Fix

Invalid DSN errors now redact credentials while keeping the scheme, host, port, database and key for diagnosis.
The fix was tested, migrated into the main project, and verification detected no regressions.


Note

Low Risk
Localized change to error message formatting only; behavior of successful DSN parsing is unchanged and tests assert secrets stay out of error strings.

Overview
Invalid Postgres and ClickHouse DSN parsing errors no longer echo passwords in their Display text. Every DsnError variant now formats URLs through a new redacted() helper instead of Debug ({:?}).

The helper masks userinfo (postgres://***@host/...) and password= query values (password=***) while leaving scheme, host, port, path, and other query keys intact for troubleshooting. It works on raw strings so redaction still applies when the URL cannot be fully parsed.

Coverage is added in errors_redact_credentials_but_keep_diagnostic for postgres authority passwords, ClickHouse query passwords, and mixed invalid-parameter cases.

Reviewed by Cursor Bugbot for commit cc76dac. Bugbot is set up for automated code reviews on this repo. Configure here.

@cla-assistant

cla-assistant Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ walsykerem
❌ Kerem


Kerem seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit cc76dac. Configure here.

Comment thread src/dsn.rs Resolved
Comment thread src/dsn.rs Resolved
@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

AI review gate — Cursor Bugbot found issues

  • Cursor Bugbot found issues that are not resolved (check concluded 'neutral').

Unresolved findings (2):

What to do:

  • Fix the findings and push. The reviewer re-reviews the new commit and the gate re-runs by itself.
  • Finding wrong, or reviewer stuck? Ask a human with write access who is not the PR author to approve this exact commit, then re-run the gate. Their approval stands in for the AI review (a new push needs a new approval).

Re-run the gate with “Re-run jobs” after an approval or a finished review. A push re-runs it automatically.

@serprex serprex closed this Nov 26, 2026
@serprex serprex reopened this Nov 26, 2026

@serprex serprex left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, not sure why CLA is choking on whoever Kerem is in your commits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants