A vulnerability in the way some developers are implementing Ethereum has resulted in a last-minute fix to The DAO, a distributed autonomous organization with over $150m at its disposal to invest in Ethereum-based projects.

Without a leader or any formal security team to identify and fix potential security threats, that responsibility falls to an open-source community comprised of members who bought voting rights in the organization with ether as part of its creation phase.

While the identities of some of those involved are still unclear, the method by which the vulnerability was identified and reportedly fixed amounts to the first real-world test of The DAO’s structure and problem-solving techniques.

Through the grapevine

The issue kicked off last week, when GitHub user chriseth “casually pointed out a terrible, terrible attack on wallet contracts” that could arise from the way some developers were implementing smart contracts written with Ethereum’s Solidity language, according to Blockchain Foundation founder Peter Vessenes.

Vessenes’ own blog post about the issue then caught the attention of a Reddit user affiliated with the Maker DAO, which is built on the Ethereum blockchain.

The vulnerability, which lets attackers drain one particular type of account, was then successfully tested by the Maker DAO, according to their post, which in turn caught the attention of eththrowa, a user of The DAO members’ forum.

Eththrowa confirmed that the vulnerability also existed in the implementation then being used by The DAO, which was built using open-source software written by Slock.it, and is the largest distributed autonomous organization with about $162m worth of ether currently at its disposal.

It was that post that, in the end, caught the attention of Slock.it founder Stephen Tual. He, along with other forum members, promptly responded and a day later posted a link to a fix.

Yesterday, Tual announced a series of upgrades to the project’s software designed to combat the vulnerability and other game theoretical attack vectors unrelated to the “recursive call” vulnerability as it is now being called.

In his post, Tual wrote:

“We extend our gratitude to the community … who once again proved that an open development process leads to the rapid identification, isolation and resolution of potential vulnerabilities, and in this case, the overall improvement of design patterns as part of programming languages.”

No DAO funds were at risk due to the vulnerability, according to a separate post.

Wider issue

Launched earlier this year by an unnamed person or group, The DAO is built on open-source code that lets users collectively vote on how to both disperse funds to projects that members think are worthy and receive dividends if the project is successful.

In this case, the vulnerability would have let a recipient of those dividends “drain many times his entitlement by calling the contract recursively,” according to eththrowa.

But as Vessenes’ post on Friday made clear, the recursive call threat wasn’t about just a weakness in The DAO, but a more general issue with the way some developers implement smart contracts written with the Solidity programming language.

In an email to CoinDesk, Vessenes provided a more technical description of the vulnerability:

“All public Solidity functions that send money or use “call” on another contract may be called recursively by an attacking recipient. This isn’t how Bitcoin works, so it might be a surprise to inexperienced Ethereum developers. The practical implication is that each of your functions (and in fact your entire contract) should be ‘reentrant’, which is to say they should function the same if parts of it are re-called prior to completion.”

The fixes

Ethereum Foundation member Taylor Gerring told CoinDesk that Vessenes’ original description of the problem was accurate. However, he added that the vulnerability won’t require any changes to the Ethereum codebase to fix.

Rather, the vulnerability requires a different kind of implementation by developers.

In interview, Gerring said the vulnerability “is a concern insofar as a human programmer may make this problem” but “it’s not an inherent problem with Solidity or EVM [the Ethereum Virtual Machine]”, the scripting language and code interpreters that power the network.

Vessenes included two possible solutions to the “recursive call” weakness in his post.

Other fixes specific to The DAO’s code also announced yesterday by Slock.it are designed to resolve potential issues that some have pointed out regarding the organization’s governance model.

Specifically, these are fixes to certain game theoretical attacks, including what is called a “yes bias”, which results from a disincentive to cast “no” votes. The fixes have been implemented in the form of pull requests on GitHub.

Now it’s up to the 23,000 voting members of The DAO to agree to the changes or push for an alternative solution.

Tual wrote on the Slock.it blog:

“This is a completely open-source project. Starting today and during the course of a two week review period, everyone including curators are encouraged to review and participate in the release.”

Crowd image via Shutterstock