Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Fix #77: don't show password in plaintext in console #82

Merged
merged 6 commits into from
Jan 2, 2019

Conversation

pmespresso
Copy link
Contributor

@pmespresso pmespresso commented Dec 28, 2018

#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.

Copy link
Collaborator

@amaury1093 amaury1093 left a 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?

@@ -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'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

const

@@ -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();
Copy link
Collaborator

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

packages/api/src/transport/ws/ws.js Outdated Show resolved Hide resolved
let safe_params;
if (dangerous_methods.includes(method)) {
safe_params = params.slice();
safe_params[params.length - 1] = '***';
Copy link
Collaborator

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.

Copy link
Collaborator

@amaury1093 amaury1093 left a comment

Choose a reason for hiding this comment

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

👍

@amaury1093 amaury1093 merged commit de07639 into master Jan 2, 2019
@amaury1093 amaury1093 deleted the yj-remove-password-from-console branch January 2, 2019 14:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants