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

Passwords written (not hidden or hashed) in log files #10175

Closed
bseclier opened this issue Jul 10, 2018 · 8 comments
Closed

Passwords written (not hidden or hashed) in log files #10175

bseclier opened this issue Jul 10, 2018 · 8 comments
Labels
Milestone

Comments

@bseclier
Copy link

Hi,
We are facing some troubles here. Looking into my logfile, I can see all my user's passwords, not hidden. Here is the kind of log (in the text file attached). I replaced the real password by PASSWORD HERE NOT HIDDEN and the true login by MY LOGIN.

It seems that when OC\User\Session->createSessionToken is logged, we can see the password.
Here is my log configuration (in WARN mode) :
'logfile' => '',
'log_type' => 'syslog',
'loglevel' => '2',
'syslog_tag' => 'nextcloud',

Thanks for taking care of it.
Cheers,
nextcloud.log

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #293 (Log still written as owncloud.log), #8104 (clear text password in log file when ldap not available), #2304 (Config error should not lead to user passwords in log), #2631 (Warning logged when logging in with an email address and password.), and #7217 (Decrypt a file when username and password known).

@bseclier
Copy link
Author

bseclier commented Jul 10, 2018

Hi little bot,
Thank for the advice but no, this is not.
And this is not an enhancement, this is a severe bug !

@MorrisJobke
Copy link
Member

@bseclier I guess you are talking about this entry:

An exception occurred while executing 'INSERT INTO `oc_authtoken`(`uid`,`login_name`,`password`,`name`,`token`,`type`,`remember`,`last_activity`) VALUES(?,?,?,?,?,?,?,?)' with params [******]:\n\nSQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '80f3eea1ff2b36763a38d028ccca401e8e4719a4f746a56ee4d45459ebfd9616' for key 'authtoken_token_index'

The with params [******] is where you replaced the variables, right?

@nickvergessen Any chance to hide it only for queries to oc_authtoken?

@MorrisJobke
Copy link
Member

@rullzer
Copy link
Member

rullzer commented Jul 11, 2018

@MorrisJobke no it is not in that query as there the password is encrytped anyways already

it is in the stacktrace at

public function createSessionToken(IRequest $request, $uid, $loginName, $password = null, $remember = IToken::DO_NOT_REMEMBER) {

@bseclier
Copy link
Author

You're right @rullzer !

@nickvergessen
Copy link
Member

time to raise priority on a little script which looks for parameter names and checks that the method name is in the block list, he?

Anyway, I guess adding createSessionToken to the list of "bad" methods should be good enough?

@MorrisJobke
Copy link
Member

Fix is in #10193

@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Jul 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants