Invalid checkpoint

Installed Linux Mint on my Mini Thermaltake Q PC last night and downloaded the PeerUnity wallet and it is doing the same thang the wheel is spinning on the bottom right but dont think the block is updating at all. Eeeekkkk :’( :omg: ??? :-/ :))

…Update- Blockchain is downloading will see what it does when it is 100% downloaded

According to my logs, the problem started between 2015-11-09 08:30 UTC and 2015-11-09 09:00 UTC with the transaction 2d00a7349e5d281406a9e78c3af5d14dd0b3df2dedbc61c08e02e909797c6ecf.

askfor tx 2d00a7349e5d281406a9   0
sending getdata: tx 2d00a7349e5d281406a9
ERROR: ConnectInputs() : 2d00a7349e VerifySignature failed
ERROR: CTxMemPool::accept() : ConnectInputs failed 2d00a7349e

So it just looks like a transaction with an invalid signature, which should be rejected.

The strange thing is that some blocks tried to include that transaction creating chain forks:

  • block f3cf770a54c384ab31420096165aa36e87a554cda3edf0437d1360686e3d0385 at height 204604
  • block aefe494921c7f835ed8d88d1ec65ae72af133061de293464081ebb78742d399c at height 204610
  • block 8350ac92844dfe4d8308d06fc4ecf379a98b0657f8b6435546f620888174adcc at height 204614

And it appears that several hours later this transaction is still causing problems:

REORGANIZE
REORGANIZE: Disconnect 20 blocks; 388c5c875d1ab37ff7b9..c239f717044faa5a1628
REORGANIZE: Connect 16 blocks; 388c5c875d1ab37ff7b9..0000000000000004ab3f
ERROR: ConnectInputs() : 2d00a7349e VerifySignature failed
ERROR: Reorganize() : ConnectBlock 8350ac92844dfe4d8308 failed
InvalidChainFound: invalid block=0000000000000004ab3f  height=204629  trust=7031636846274999
InvalidChainFound:  current best=c239f717044faa5a1628  height=204633  trust=7031827283093680
ERROR: SetBestChain() : Reorganize failed
ERROR: ProcessSyncCheckpoint: SetBestChain failed for sync checkpoint 0000000000000004ab3f5f5968d116d1e488adec2c78c3cfef113eb8d76e63b

Hmm someone trying to Hack the Peercoin blockchain and fork it? ??? Looks like the code caught it.

I run multiple versions of ppcoind and I can confirm that older version accepts that malformed transaction without problems while newer does not.

Version of ppcoind that accepts tx: https://github.com/ppcoin/ppcoin/commit/613a559a22ba8690381e37e541854b2f36ec2c99
Version of ppcoind that does not accept tx: https://github.com/ppcoin/ppcoin/commit/5ace24f056a06e37352c0dd861be8ab195aceaf8

So the problem should be somewhere between these versions but there are only 2 commits that were introduced in between.
I don’t think that openssl update could cause this.

Totally confused.

Seeing this problem as well with
peerunity “version” : “v0.1.2.0-g89ca26e”,

but only on one of two machines (the other runs the same peerunity version), which is very odd.

Someone crafted a signature to exploit a bug that caused the network to split. Basically there’s one side with Linux 32 bits and Windows 32 and 64 bits, and another side with Linux 64 bits. But Linux 64 bits may also be on the other side if they compiled from the source code and use OpenSSL 1.0.1k or above. The synchronized checkpoints are on the 64 bits Linux side. So if you’re on the other side you get the warning.

I wrote a quick fix in the “der_length_fix” branch in the peercoin repository. It’s not been reviewed yet so be careful. I don’t have the tools ready to build binaries.

The technical discussion is here: https://github.com/ppcoin/ppcoin/issues/100

[quote=“willy, post:9, topic:3691”]Seeing this problem as well with
peerunity “version” : “v0.1.2.0-g89ca26e”,

but only on one of two machines (the other runs the same peerunity version), which is very odd.[/quote]

Just to add: The machine on the wrong chain has peerunity compiled from source.
Machine two, which is working on the “correct” chain, uses the official peerunity binaries.

I’m pretty much setup to produce Windows and Linux builds, can do MAC build but never got the signing of the MAC build sorted so if anyone can help there we can have new binaries up pretty quick.

Fuzzybear

Sent from my HTC Desire using Tapatalk 2

[quote=“sigmike, post:10, topic:3691”]Someone crafted a signature to exploit a bug that caused the network to split. Basically there’s one side with Linux 32 bits and Windows 32 and 64 bits, and another side with Linux 64 bits. But Linux 64 bits may also be on the other side if they compiled from the source code and use OpenSSL 1.0.1k or above. The synchronized checkpoints are on the 64 bits Linux side. So if you’re on the other side you get the warning.

I wrote a quick fix in the “der_length_fix” branch in the peercoin repository. It’s not been reviewed yet so be careful. I don’t have the tools ready to build binaries.

The technical discussion is here: https://github.com/ppcoin/ppcoin/issues/100[/quote]

Great Thanks to you Sigmike. Peercoin is lucky to have you :slight_smile:

Yes, thank you sigmike!

Status update: sigmike has published v0.4.1 RC1 including fixes for both 32-bit nodes and for 64-bit nodes locally built with openssl 1.0.1k+ (Great job, sigmike!). We have agreed that the checkpointed blockchain fork is the supported fork. This is the blockchain fork that all linux 64 bits running official v0.4.0 builds accepted, which includes the transaction sent by the attacker, using a signature format not recognizable by v0.4.0 32 bit builds.

If you are running official linux 64-bit client, no further action is necessary. Other users should avoid sending transactions before upgrading client once the official builds become available.

Official windows build of v0.4.1 RC1 has been started. Once it is ready I will post another update.

[quote=“Sunny King, post:15, topic:3691”]Status update: sigmike has published v0.4.1 RC1 including fixes for both 32-bit nodes and for 64-bit nodes locally built with openssl 1.0.1k+ (Great job, sigmike!). We have agreed that the checkpointed blockchain fork is the supported fork. This is the blockchain fork that all linux 64 bits running official v0.4.0 builds accepted, which includes the transaction sent by the attacker, using a signature format not recognizable by v0.4.0 32 bit builds.

If you are running official linux 64-bit client, no further action is necessary. Other users should avoid sending transactions before upgrading client once the official builds become available.

Official windows build of v0.4.1 RC1 has been started. Once it is ready I will post another update.[/quote]

Thank You Sunny! You are the man. :wink: It’s a good thing to get the rare bug worked out before Peercoin has rocketed up in value.

Non-pressing question for Sigmike or Sunny:
Because Peercoin is BTC code compliant, does this mean Bitcoin is susceptible to this attack?

@NME this is not a new exploit, it was discovered Tue Jul 28 14:27:18 UTC 2015 by Pieter Wuile who also patched it before disclosing the vulnerability

Bitcoin avoided the problem by making a protocol change before the bug was disclosed. We can't do that anymore so we have to make a fix.
In bitcoin, this issue was solved with BIP66. Read here for more info:

https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2015-July/009697.html
https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki

read all about it here https://github.com/ppcoin/ppcoin/issues/100

basically, it is kind of a noob attack imo, some scriptkiddy went through all the bitcoin commits/patches and tries to attack altcoins with it which haven’t patched the vulnerabilities yet

edit: maybe the question should be, are there still more known vulnerabilities like this that need to be patched?

I’ve sucessfully build “v0.4.1.0-g2c87899-beta” on my RPi 2.
No errors. Correct chain.

Update: Windows build of 0.4.1 RC1 is now available, which should allow windows node to get back to the supported blockchain fork.
http://sourceforge.net/projects/ppcoin/files/0.4.1%20RC1/ppcoin-0.4.1rc1-win32-setup.exe/download
sha256sum: c0fa41ad46ee6c27571a39e6bac4ef68d92f6e2b8c53919472ead98bc31c4bdb

Please always backup wallet before proceeding. Also note down your total balance/stake.
Uninstall version 0.4.0.
Install version 0.4.1 RC1.

Is it safe for users to transact using v0.4.1 RC1 or should we wait for upgrades at exchanges before going out with such a message?

Can someone merge this ASAP: https://github.com/super3/peercoin.net/pull/239

Should be home in an hour ill do it then

Fuzzybear

Sent from my HTC Desire using Tapatalk 2

I can confirm that sha256sum of ppcoin-0.4.1rc1-win32-setup.exe is: c0fa41ad46ee6c27571a39e6bac4ef68d92f6e2b8c53919472ead98bc31c4bdb

Should be home in an hour ill do it then

Fuzzybear

Sent from my HTC Desire using Tapatalk 2[/quote]

Thanks :slight_smile: