correct passphrase crashes client after 50+ wrong guesses. #1024

issue timmerov opened this issue on April 2, 2012
  1. timmerov commented at 3:47 AM on April 2, 2012: none

    client 0.5.0

    i forgot my passphrase to my encrypted wallet. but i knew what it was approximately. so i guessed. 50+ times. one particular guess (which i'm assuming is the correct passphrase) causes the client to crash. so i can't send bitcoins or change my passphrase. updated to client 0.6.0. it also crashes on the same passphrase.

    google says others have had a similar problem. but the issue was closed because it couldn't be reproduced.

    dbdump --wallet shows no errors. though this line looks suspicous:

    Master Key 1: blah...blah, Salt: blah...blah. Passphrase hashed 83218 times with method 0 with other parameters 0x

    i haven't looked at the source but... that 83 thousand times thing looks kinda suspicious. is there a security feature that increases the passphrase hash count every time an incorrect passphrase is entered? is there a buffer or stack overflow thing going on when the hash count gets too high? chirp.

  2. gmaxwell commented at 3:53 AM on April 2, 2012: contributor

    Do you have a backup of your wallet from before this issue happened?

  3. timmerov commented at 4:20 AM on April 2, 2012: none

    of course not.

  4. Diapolo commented at 11:35 AM on April 3, 2012: none

    What about a try with 0.6 and the switch -walletupgrade (https://bitcointalk.org/index.php?topic=74858.0)? But use a copy of your wallet.dat just in case ...

  5. timmerov commented at 3:15 PM on April 3, 2012: none

    same crash as described above with version 0.6.0.6 beta after -walletupgrade when i try to change my passphrase.

  6. brokewallet commented at 7:55 PM on April 3, 2012: none

    I ran into the same issue after upgrading to 0.6.0.6-beta, and same potential root cause, I tried entering the passphrase probably 30+ times and now when I try the correct phrase it crashes when attempting to send coins.

    "This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information"

    In the debug.log


    EXCEPTION: 9key_error
    CKey::SetSecret() : secret must be 32 bytes
    N:\Program Files\Bitcoin.latest\bitcoin-qt.exe in Runaway exception

    I've tried killing my bitcoin directory and reloading all the blocks, even under different versions of bitcoin. I do have a backup prior to all of this from jan (it must have been after I encrypted my wallet) but that one has the same issue which is strange since it was backed up on a different computer (not running bitcoin) and hasnt been modified since then.

    I've looked around at issue 955 and 711, ran bitcointools but it didnt complain about anything. I've even tried using the backup-ed wallet and bitcointools new wallet on another machine and it still crashes.

    I tried using the -upgradewallet switch, same issue (Log shows "performing wallet upgrade to 60000). The problem also happens if i try to change my passphrase.

    Any suggestions?

  7. brokewallet commented at 4:39 PM on April 4, 2012: none

    Update: I found the right pass it looks like the crash was being caused on an incorrect pass.

    Using 0.6.0.6-beta trying (incorrect-password1) when attempting to send coins or change passwords the client crashes. Because of this I figured it was the correct password due to other incorrect passwords not causing the client to crash (they would just cause the client to report incorrect pass).

    Figuring that one or more of the keys were corrupted sipa gave me two custom clients.

    first patched client http://bitcoin.sipa.be/builds/0.6.0-1-gc8bd77b/ (404'd now I guess you should ask him if you really need it) When this was run with -recovery flag it checks all keys at decryption time and ignores the faulty ones, so if you use the wrong pass it wont have any funds since the decryption will fail. This tried to use a key that was removed (when i stupidly was using the wrong pass at this point) since it doesnt prevent the coin mechanism from choosing those coins or update the balance.

    second patched client http://bitcoin.sipa.be/builds/0.6.0-1-g694cc14/ again you run this with -recovery from the cli or it will just be the same as 0.6.0.6-beta I believe. Using this patch it reports in the debug output which keys were removed because of which reason, and should update the balance. So if you use the wrong pass decryption will fail and the balance will show 0.00.

    After writing down all permutations of what my pass could be I found the correct passphrase and the released 0.6.0.6-beta client works as expected. I'll email the empty wallet to gmaxwell and hopefully he can figure out why the wrong pass causes it to crash.

  8. sipa commented at 12:35 AM on April 5, 2012: member

    This should be fixed by #1039.

  9. timmerov commented at 5:18 AM on April 5, 2012: none

    ur teh r0x0rz. err... mostly. i still have to guess my passphrase. wee.

  10. gmaxwell closed this on Apr 6, 2012

  11. suprnurd referenced this in commit 19ae48a02e on Dec 5, 2017
  12. sanch0panza referenced this in commit 2deb744f5f on Apr 11, 2018
  13. Bushstar referenced this in commit 0e1621cc4a on Oct 14, 2019
  14. lateminer referenced this in commit 98aa3fa438 on Oct 30, 2019
  15. 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