-
Notifications
You must be signed in to change notification settings - Fork 40
Fix #77: don't show password in plaintext in console #82
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yjkimjunior I agree with you, I don't think it's a security issue neither, because the password (wrong or correct one) is always shown in the network tab. But let's still merge this, if anything it'll make the users feel safer.
Can we instead show "***"
instead of the password?
packages/api/src/transport/ws/ws.js
Outdated
@@ -261,6 +261,11 @@ class Ws extends JsonRpcBase { | |||
|
|||
// Don't print error if request rejected or not is not yet up... | |||
if (!/(rejected|not yet up)/.test(result.error.message)) { | |||
var dangerous_methods = ['signer_confirmRequest', 'signer_confirmRequestWithToken']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const
packages/api/src/transport/ws/ws.js
Outdated
@@ -261,6 +261,11 @@ class Ws extends JsonRpcBase { | |||
|
|||
// Don't print error if request rejected or not is not yet up... | |||
if (!/(rejected|not yet up)/.test(result.error.message)) { | |||
var dangerous_methods = ['signer_confirmRequest', 'signer_confirmRequestWithToken']; | |||
if (dangerous_methods.includes(method)) { | |||
params.pop(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't use pop(), since it alters params
, which might be used somewhere else
let safe_params; | ||
if (dangerous_methods.includes(method)) { | ||
safe_params = params.slice(); | ||
safe_params[params.length - 1] = '***'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add a comment somewhere here, to tell future devs what we're doing here, it might not be obvious at 1st sight.
Co-Authored-By: yjkimjunior <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
#77
@ltfschoen, I've made this edit to address the downstream bug in Fether - openethereum/fether#317
I'm not convinced this is actually a security bug however since:
a) it only logs when the password is incorrect, and
b) in production the developer console would not be accessible,
though of course, I'm all ears to learning about why it actually is an issue.