MIT tests 'software transplants' to fix buggy code

MIT researchers have shown a way to fix flaws using code copied from a working program

MIT's new CodePhage technology can borrow the successful bits of one program to fix another.

MIT's new CodePhage technology can borrow the successful bits of one program to fix another.

Like visiting a junk yard to find cheap parts for an aging vehicle, researchers from the Massachusetts Institute of Technology have come up with a way to fix buggy software by inserting working code from another program.

Using a system they call CodePhage, the researchers were able to fix flaws in seven common open-source programs by using, in each case, functionality taken from between two and four "donor" programs.

Fixing such errors can help make code more secure, since malicious hackers often exploit flaws to gain entry to a system. CodePhage can recognize and fix common programming errors such as out of bounds access, integer overflows, and divide-by-zero errors.

The researchers describe their approach in Monday's edition of the journal Phys.Org. They also discussed it at a programming conference put on last month by the Association for Computing Machinery.

To fix a buggy program, CodePhage requires two sample inputs, one that causes the program to crash, and another that does not.

It runs those inputs through a second program, known as the donor program, that has similar functionality. The Internet is awash with open source software that could provide parts for donor programs, though there's no particular reason the donor code needs to be open source.

Watching the donor program process the crash-free input, CodePhage notates all the actions taken. It then runs the input that caused the original program to crash, again notating the actions, in symbolic logic. CodePhage then analyzes how the two inputs were handled differently, and uses that information to correct the original program.

In many cases, the program being analyzed lacks the required security check present in the donor program. Up to 80 percent of a typical application can be code for conducting security checks. CodePhage could reduce the time developers spend writing those checks, by inserting them automatically into the build process, the researchers said.

MIT isn't the only organization looking for novel ways to repair vulnerable software. Earlier this year, security vendor Qualys released software that can apply virtual patches to known vulnerabilities, eliminating the need to wait for the software vendor to patch the problem.

Joab Jackson covers enterprise software and general technology breaking news for The IDG News Service. Follow Joab on Twitter at @Joab_Jackson. Joab's e-mail address is

Join the PC World newsletter!

Error: Please check your email address.

Tags patchessecurityMassachusetts Institute of TechnologyExploits / vulnerabilities

Our Back to Business guide highlights the best products for you to boost your productivity at home, on the road, at the office, or in the classroom.

Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Joab Jackson

IDG News Service
Show Comments

Most Popular Reviews

Latest News Articles


GGG Evaluation Team

Kathy Cassidy


First impression on unpacking the Q702 test unit was the solid feel and clean, minimalist styling.

Anthony Grifoni


For work use, Microsoft Word and Excel programs pre-installed on the device are adequate for preparing short documents.

Steph Mundell


The Fujitsu LifeBook UH574 allowed for great mobility without being obnoxiously heavy or clunky. Its twelve hours of battery life did not disappoint.

Andrew Mitsi


The screen was particularly good. It is bright and visible from most angles, however heat is an issue, particularly around the Windows button on the front, and on the back where the battery housing is located.

Simon Harriott


My first impression after unboxing the Q702 is that it is a nice looking unit. Styling is somewhat minimalist but very effective. The tablet part, once detached, has a nice weight, and no buttons or switches are located in awkward or intrusive positions.

Featured Content

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?