MIT's CodePhage helps computers automatically detect, devour their own bugs
Loading...
Researchers from听Massachusetts Institute of Technology say they've developed a way to automatically find and fix one of the most common types of software bugs without even seeing a program's source code.听Instead, it detects glitches as programs run, and repairs them by borrowing functionality from other applications.听
"It鈥檚 actually surprising that it works," says听Emery Berger, a University of Massachusetts at Amherst professor who served on the review committee at the mid-June Association for Computing Machinery conference where the听repair system, dubbed CodePhage, debuted.
The bug, known as a buffer overflow, has been听a nuisance for programmers and security professionals for decades. It was the heart of malware and vulnerabilities ranging from the famous Morris Worm in the 1980s to widely publicized exploits named Venom and Ghost this year. Depending on how and where an overflow is used, it could theoretically听give an attacker complete control over a听system.听
The flaw happens when more data is directed to a block of memory than it can handle 鈥 and, therefore, it overflows.听The extra data overwrites whatever is stored in the next block of memory. That could mean changing information used in a program or adding in commands to run malicious programs.听
When an overflow occurs, the听CodePhage system searches听public archives of open source software for a program that handles the same type of data without overflowing. It then adapts the听data entry portion of the working program into a patch for the broken one. In CodePhage's designers' jargon, it finds a "donor" for the ailing application.
Still,听finding a compatible program is a challenge. Most software isn't听designed using interchangeable parts. Similar segments of different programs can be wildly different 鈥 they can use different names, different parameters, and incorporate different functionalities.
"It's听a lot like playing hide-and-go-seek in the dark and not knowing who else is playing the game," says MIT computer science Prof. Martin Rinard, who worked on the team at MIT's Computer Science and Artificial Intelligence Laboratory headed by research scientist Stelios Sidiroglou-Douskos.
CodePhage evaluates exactly what code to take from a donor by tracing the path of input data as it works its way into a computer's memory.听
Dr. Rinard hopes that automating the detection and patching processes will reduce the chance that an attacker can take advantage of the bug within a system. "One of the biggest problems is the significant delay after discovering a vulnerability until it鈥檚 patched,鈥 he says. CodePhage makes the patching process much faster, Rinard says, because it "takes the human out of the process.鈥
That's critical because, while many operating systems and programming languages have gotten better about handling听buffer overflows, problems remain incredibly common, says听Amol Sarwate, director of vulnerability research at Qualys, a security firm that discovered the vulnerability known as Ghost that was caused by a buffer overflow problem.听
"If [CodePhage] could get rid of buffer overflows,鈥 says Mr.听Sarwate, 鈥渋t would get rid of the majority of headaches for people who defend networks.鈥
CodePhage is still only a lab-tested prototype, notes Professor Berger from the UMAss and with the complexities of code, problems could arise as it is used at the scale of a production product. Still, he's optimistic it can succeed. So are the scientists at MIT CSAIL, who believe they can adapt CodePhage to be used for any situation where coders make mistakes, even less critical ones such as writing inefficient code.
听