Wallet passphrase stored in buffer #548

issue enmaku opened this issue on October 3, 2011
  1. enmaku commented at 5:13 PM on October 3, 2011: contributor

    When using bitcoind and unlocking wallet.dat from the command prompt, with the current implementation the passphrase will be stored plaintext in the command buffer on many operating systems. The command-line implementation should be changed such that an unlock command may (optionally) be issued without specifying the passphrase and have the user prompted for the passphrase from within the application so that it does not enter the buffer.

  2. alexwaters commented at 5:47 PM on October 3, 2011: contributor

    Gavin discussed the whack-a-mole security issues with sensitive data being stored in memory, and I think this falls into that category. IMO this is more of a problem outside the scope of Bitcoin, but still important to be mindful of. Regardless, obscuring this data could slow down or prevent a potential attack.

    Can you propose how we could prevent this?

  3. tcatm commented at 5:49 PM on October 3, 2011: none

    One simple solution would be to prefix the command with a space. This prevents most shells from saving it the user's history:

    $ [space]bitcoind command args...

    It'll still show up in the process list, though.

  4. enmaku commented at 5:53 PM on October 3, 2011: contributor

    Right now I'm doing this in Python:

    from jsonrpc import ServiceProxy access = ServiceProxy("http://127.0.0.1:8332") pwd = raw_input("Enter wallet passphrase: ") access.walletpassphrase(pwd, 60)

    So all that shows up in my buffer is "walletunlock.py" but it should be possible to simply run "bitcoind walletpassphrase" and have it prompt you to enter the passphrase rather than demand it as a command line argument.

    On Mon, Oct 3, 2011 at 10:49 AM, Nils Schneider < reply@reply.github.com>wrote:

    One simple solution would be to prefix the command with a space. This prevents most shells from saving it the user's history:

    $ [space]bitcoind command args...

    It'll still show up in the process list, though.

    Reply to this email directly or view it on GitHub: #548 (comment)

  5. TheBlueMatt commented at 8:14 PM on October 3, 2011: member

    This was brought up before wallet encryption was merged and the decision was that this falls well outside of the scope of wallet encryption but falls more in the scope of making the rpc client more of a shell instead of calling individual commands.

  6. gavinandresen commented at 8:50 PM on October 3, 2011: contributor

    walletunlock.py would be a nifty addition to the contrib/ directory. Can you turn it into a pull request?

  7. enmaku commented at 9:12 PM on October 3, 2011: contributor

    Done. I also included walletchangepass.py which does exactly what it sounds like it does. #549

  8. alexwaters commented at 11:30 PM on October 3, 2011: contributor

    Nice! Closing this issue to consolidate on the above mentioned pull request.

  9. alexwaters closed this on Oct 3, 2011

  10. ptschip referenced this in commit d49f49d485 on May 12, 2017
  11. kallewoof referenced this in commit c1c4757937 on Oct 4, 2019
  12. Losangelosgenetics referenced this in commit 22dc49d957 on Mar 12, 2020
  13. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me