14

personal.unlockAccount(eth.accounts[0],"")

Error: account unlock with HTTP access is forbidden

I run Geth in a Docker container and use

docker exec -it bootstrap geth --datadir=~/.ethereum/devchain attach

to exec the Geth console.

  • 2
    Same problem here, I think it is as a result of some geth update. – Oleg Belousov Apr 9 at 11:07
12

Yes, is some geth update, see more about it here - https://github.com/ethereum/go-ethereum/pull/17037. If you want to enable unlock with opened http (security risk), you can use "--allow-insecure-unlock" option to bypass this protection.

  • 1
    Sorry, I am still confused where to append 'allow-insecure-unlock'? – Wayne Apr 9 at 16:54
  • 1
    In your case something like: docker exec -it bootstrap geth --datadir=~/.ethereum/devchain --allow-insecure-unlock attach – Artur Iablokov Apr 10 at 9:20
  • 1
    It still shows the Error: account unlock with HTTP access is forbidden, why? – Wayne Apr 10 at 15:10
  • 1
    try to add "--allow-insecure-unlock" option when you start/run the eth-node. – Artur Iablokov Apr 11 at 9:12
2

It looks like you have geth open with --rpc, enabling HTTP access. If you unlock the account, anybody who can access that node by HTTP can do anything they like with that account, such as moving all funds to a different address that only they have a key to, or otherwise mess with whatever you're trying to accomplish. There are bots scanning for these sorts of vulnerabilities all over and you might suffer from the security hole even if not specifically targeted.

The best solution is probably not to allow insecure unlocking of accounts, though the dangers are considerably less if a strong firewall prevents external HTTP access on the relevant ports. A better solution would be to think more carefully about why you think you need the account unlocked, and if there are ways to accomplish those goals other than unlocking and leaving the account wide open. Alternatively, you could do the unlock on another node on the same blockchain network which does not enable RPC/HTTP access.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.