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

Clef: cliui mixes extraneous and approval-specific Data #17637

Closed
holiman opened this issue Sep 11, 2018 · 2 comments
Closed

Clef: cliui mixes extraneous and approval-specific Data #17637

holiman opened this issue Sep 11, 2018 · 2 comments
Assignees

Comments

@holiman
Copy link
Contributor

holiman commented Sep 11, 2018

Ref: NCC-EF-Clef-006

When Clef receives a request through its exposed API, metadata is displayed to the user in
charge of handling it. This metadata includes a variety of fields unrelated to what is being
signed like IP address, user-agent, origin, etc. There are 6 calls to showMetadata() within
signer/core/cliui.go that drive this functionality. Some of these fields can be trivially
tampered with and might provide a false understanding as users could rely too heavily on
them instead of the important fields.
The following ‘malicious’ request (with the redacted JSON taken from Go code example com-
ments) will be accepted by Clef.

curl-i http://localhost:8550/ \
-H "Content-Type: application/json"\ 
-X POST --data '{...}' \
-A "indicates INVALID CHECKSUM IS EXPECTED" \
-H "Origin: NCC Group requires IMMEDIATE APPROVAL per direction of J Smith"

cliui

As currently presented, the metadata provides little benefit to legitimate requests but may
facilitate illegitimate requests. A naive user may consider the extraneous request data as
superseding the true warning above and mistakenly approve this transaction.

Recommendation

Do not present request metadata alongside approval-specific data without clear delineation
and warnings. Either clearly label the categories presented and warn that request data
cannot be relied upon, or simply remove all request data.


Todo: look into if we can make this even more clear than it is currently.

@holiman holiman self-assigned this Sep 11, 2018
@holiman
Copy link
Contributor Author

holiman commented Sep 12, 2018

I made a slight change, now it looks like this:

--------- Transaction request-------------
to:    0x07a565b7ed7d7a678680a4c162885bedbb695fe0

WARNING: Invalid checksum on to-address!

from:     0x82A2A876D39022B3019932D30Cd9c97ad5616813 [chksum ok]
value:    16 wei
gas:      0x333 (819)
gasprice: 291 wei
nonce:    0x0 (0)
data:     0x4401a6e40000000000000000000000000000000000000000000000000000000000000012

Transaction validation:
  * WARNING : Invalid checksum on to-address
  * Info : safeSend(address: 0x0000000000000000000000000000000000000012)


Request context:
	127.0.0.1:47808 -> HTTP/1.1 -> localhost:8551

Additional HTTP header data, provided by the external caller:
	User-Agent: indicates INVALID CHECKSUM IS EXPECTED
	Origin: NCC Group requires IMMEDIATE APPROVAL per direction of J Smith
-------------------------------------------
Approve? [y/N]:

I think that should be sufficient. We cannot remove all request data, in 99.9% of the cases, it's highly valuable information which can protect against drive-by-download types of attacks, where a webpage spuriously sends a request to the signer. By showing origin, the user would see what webpage is doing this. By showing user-agent, the user could see if it's his own browser or something else doing the requests -- assuming an attacker does not know what browser the user is using/

So overall, I think it's better to have it than to remove it.

holiman added a commit to holiman/go-ethereum that referenced this issue Sep 12, 2018
holiman added a commit to holiman/go-ethereum that referenced this issue Sep 25, 2018
holiman added a commit that referenced this issue Sep 25, 2018
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see #17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes #17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes #17632 and #17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
@holiman holiman closed this as completed Sep 25, 2018
ghost pushed a commit to Ethersocial/go-esn that referenced this issue Oct 10, 2018
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see ethereum/go-ethereum#17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes #17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes #17632 and #17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
yazzaoui pushed a commit to autonity/autonity that referenced this issue Dec 6, 2018
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see ethereum/go-ethereum#17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes #17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes #17632 and #17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
cryptomental pushed a commit to cryptomental/go-ethereum that referenced this issue Jan 9, 2019
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see ethereum#17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes ethereum#17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes ethereum#17632 and ethereum#17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
cryptomental pushed a commit to cryptomental/go-ethereum that referenced this issue Jan 9, 2019
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see ethereum#17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes ethereum#17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes ethereum#17632 and ethereum#17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
cryptomental pushed a commit to cryptomental/go-ethereum that referenced this issue Jan 9, 2019
* signer: remove local path disclosure from extapi

* signer: show more data in cli ui

* rpc: make http server forward UA and Origin via Context

* signer, clef/core: ui changes + display UA and Origin

* signer: cliui - indicate less trust in remote headers, see ethereum#17637

* signer: prevent possibility swap KV-entries in aes_gcm storage, fixes ethereum#17635

* signer: remove ecrecover from external API

* signer,clef: default reject instead of warn + valideate new passwords. fixes ethereum#17632 and ethereum#17631

* signer: check calldata length even if no ABI signature is present

* signer: fix failing testcase

* clef: remove account import from external api

* signer: allow space in passwords, improve error messsage

* signer/storage: fix typos
@matias904
Copy link

Hohono

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

No branches or pull requests

2 participants