Bitcoin Institute

"wallet" handling code should be a separate process.

1 messages BitcoinTalk ByteCoin November 8, 2010 — November 8, 2010
ByteCoin November 8, 2010 04:50 UTC Link to this message

Buffer overflow attacks against the current client could allow an unauthenticated remote attacker to steal your bitcoins.

I raised this topic in http://bitcointalk.org/index.php?topic=1688.msg20574#msg20574

The principal flaw of the current client in this respect is that it’s a large monolithic process that accepts arbitrary data from arbitrary network connections and performs complex processing on them while having full access to small valuable private keys. An attacker who could patch the client could ensure untraceable access to all future private keys (with some caveats).

The way to secure this application is by restricting the operations we allow to be performed on the private keys and by simplifying the code accessing the private keys.

The only operations that ever need to be performed on the list of private keys are “read key” and “add new random key”. A malicious process that can read an arbitrary private key can spend the coins associated with that key. A malicious process that can add a new random key can only waste storage space. As an aside, a malicious process that can add an arbitrary private key can spend the coins assigned to that key in future, so we must forbid this. To help the enforcement of these rules, the file holding the keys could be opened with only read and append permissions.

The private key handling process would accept only two commands. “Sign message” would take a message and a public key and return the signature. “Add new key” would return the new public key.

A separate process could control access to the “sign message” interface of the public key handling process. This could perhaps check that the value of the messages signed was under a certain limit before requiring user confirmation. It could check that the rate of spending was not over a certain limit or that the total sent for that day was not excessive.

The private key handling process should not attempt to parse and check the messages it signs as it makes the code vastly larger and more difficult to prove secure.

ByteCoin