Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TiDB-Lightning will print some sensitive message when it runs in server mode #36374

Closed
lichunzhu opened this issue Jul 20, 2022 · 2 comments · Fixed by #36375 or #52336
Closed

TiDB-Lightning will print some sensitive message when it runs in server mode #36374

lichunzhu opened this issue Jul 20, 2022 · 2 comments · Fixed by #36375 or #52336

Comments

@lichunzhu
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

Run TiDB-Lightning in server mode and start an import task.

2. What did you expect to see? (Required)

Lightning's log doesn't contain sensitive information.

3. What did you see instead (Required)

Lightning's log contains sensitive information.

4. What is your TiDB version? (Required)

master

@niubell
Copy link
Contributor

niubell commented Jul 26, 2022

/remove-label affects-6.2

@kennytm
Copy link
Contributor

kennytm commented Apr 3, 2024

I'm pretty sure #36375's regexp and test case are both written wrongly

passwordPatterns = `(password[\s]*=[\s]*(\\")?)(.*?)((\\")?\\n)`

`host = "127.0.0.1"\n user = "root"\n password = "/Q7B9DizNLLTTfiZHv9WoEAKamfpIUs="\n port = 3306\n`,

you don't need to escape the backslash inside the backquote-strings! `\n` will produce a literal \ followed by an n, not a newline character. The passwords are still visible in the log because the regexp isn't able to match any real text.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants