MIT develops donor 'transplants' for buggy code without access to the source

'Donor' programs provide the band-aid to fix buggy code and eliminate errors.


A team from the Massachusetts Institute of Technology (MIT) have come up with a way to use 'donor' programs to improve the functionality and reduce system errors and flaws in open-source programs.

Outlined in a paper dubbed "Automatic error elimination by horizontal code transfer across multiple applications," MIT researchers describe the Code Phage system, which automatically transfers code from donor programs to other applications which have buggy code and errors.

During testing, the MIT team -- Stelios Sidiroglou-Douskos, Eric Lahtinen, Fan Long and Martin Rinard -- used seven donor applications to eradicate a total of ten errors in open-source recipient programs.

"Because [Code Phage] works with binary donors with no need for source code or symbolic information, it supports a wide range of use cases. To the best of our knowledge, CP is the first system to automatically transfer code across multiple applications," the team says.

To begin its analysis, Code Phage requires two sample inputs: an input which triggers an error and a seed input which does not. Code Phage then taps into a database of applications which locates a donor program that processes both donors successfully.

Diving into the Dark Web: Where does your stolen data go? Diving into the Dark Web: Where does your stolen data go? If your sensitive data is stolen online, where does it go -- and who sees it? One security team found out.

"The hypothesis is that the donor contains a check, missing in the recipient, that enables it to process the error-triggering input correctly. The goal is to transfer that check from the donor into the recipient (and eliminate the error in the recipient)," the paper states.

Once this check has been identified, Code Phage explores conditional branches of the donor to find branches which take different directions in terms of seed and error-triggering inputs. Code Phage then detects the correct branch which fixes the error and automatically creates a patch to fix the bug. This patch, compiled of donor code, is then applied and tested.

According to the MIT researchers, Code Phage can be used to correct errors such as integer overflow, out-of-bounds access and divide by zero errors.

Errors in open-source programs which are widely used can be exploited by cyberattackers to cause widespread security problems. Heartbleed, the OpenSSL zero day vulnerability, for example, was a critical flaw contained in the software's cryptographic library -- and caused by a single programming error. The flaw could be exploited to intercept secure communication channels as well as potentially allow an attacker to obtain SSL keys.

Patches for serious vulnerabilities generally are issued by the vendors themselves, which could take weeks or months to develop. Open-source programs, however, do not always have dedicated debug teams and errors can remain undetected -- and exploitable -- for years. Therefore, an automatic system which completes the hard work for developers can not only reduce the time necessary to secure open-source programs, but keep users safe.

Read the full report here (.PDF).

Read on: Top picks

Show Comments