-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Passwords are being logged in plain text in beforeSave #2680
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
Comments
Bump on this - is there a quick or simple workaround? We need to migrate very soon to allow users enough time to upgrade before the cutoff. I can't in good conscience have users' plain text passwords be stored in log files on our instances. But having logs is important too. |
Can you update to 2.2.21 and let us know if the error still reproduces? |
Hey, thanks for the response - yes, I just updated to 2.2.21 and can confirm it still happens. The first log message after I try to create an account is a beforeSave that contains the user's plain-text password. |
ugh, i'm guessing that this is cause we're logging the params in the hooks. I can cook up a failing unit test. |
@acinader go ahead! |
@flovilmart failing unit test: master...acinader:password-obsfucate-cloud-triggers the first approach that comes to mind is to change logger.truncateLogMessage to logger.cleanAndTruncate.... And just search and replace on "password":"[^"]*" thoughts? |
@acinader that seems reasonable, I opened the PR with the failing test so we can keep track of the progress. any log for those should go through the cleaner :) Better perhaps, that should be at the loggerController level no? like implementing |
@all-iver you can use: |
Great, thanks a lot for the quick fix! |
Move password masking functionality into LoggerController. The is a more aggresive approach to masking password string in the logs. Cleaning the url is still in the PromiseRouter because picking it out of the log string would be fragile. This will cause more log messages to be scanned for password strings, and may cause a password string to be obsfucated that is not neccesarily part of parse internals -- but i think that is still a good thing.... see: parse-community#2755 & parse-community#2680
Move password masking functionality into LoggerController. The is a more aggresive approach to masking password string in the logs. Cleaning the url is still in the PromiseRouter because picking it out of the log string would be fragile. This will cause more log messages to be scanned for password strings, and may cause a password string to be obsfucated that is not neccesarily part of parse internals -- but i think that is still a good thing.... see: #2755 & #2680
but this is now fixed |
Issue Description
Possibly related to #1704.
Passwords are being logged in plain text for me in beforeSave when I create a new user. They show up in my nodejs.log and in parse-dashboard. This is with verbose mode turned off.
Steps to reproduce
In your beforeSave, do something like the following (not sure if this is a necessary step but it's what I'm doing):
Then, create a new user.
Expected Results
No passwords should ever be displayed or stored in plain text.
Actual Outcome
I get this in my logs:
Environment Setup
Logs/Trace
See above.
The text was updated successfully, but these errors were encountered: