Users and administrators of Ubuntu Linux desktops are being advised to patch their systems following the disclosure of serious security flaws.

Researcher Donncha O'Cearbhaill, who discovered and privately reported the vulnerabilities to the Ubuntu team, said that a successful exploit of the bugs could allow an attacker to remotely execute code by tricking a victim into downloading a maliciously booby-trapped file. The exploitable flaws are present in Ubuntu 12.10 and greater.

He notes that while the security oversights are dangerous in their own right, the process of discovering and reporting the bugs opened his eyes to a wider problem affecting researchers working with open platforms.

In this case, O'Cearbhaill says, his exploit code takes advantage of the Apport crash reporting tool on Ubuntu.

The researcher found he could inject code into the OS's crash file handler by crafting a crash file that, when parsed, executes arbitrary Python code:

The code first checks if the CrashDB field starts with { indicating the start of a Python dictionary. If found, Apport will call Python’s builtin eval() method with the value of the CrashDB field. eval() executes the passed data as a Python expression which leads to straight forward and reliable Python code execution.

By exploiting the flaws (designated CVE-2016-9949 and a related path traversal bug CVE-2016-9950), an attacker would have the ability to gain control over the targeted Ubuntu box simply by convincing them to open a single document that then targets the flaws in the crash reporter.

O'Cearbhaill has provided a copy of the source code for his proof-of-concept on GitHub, as well as a video showing the exploit in action – opening a ZIP archive from the internet containing a malicious crash report runs a calculator program. Substitute the calculator for something harmful and, well, there you go.

"I would encourage all security researchers to audit free and open source software if they have time on their hands," the researcher said.

"Projects such as Tor, Tails, Debian and Ubuntu all need more eyes for audits which can improve the safety of the internet for everyone."

At the same time, O'Caerbhaill notes the reality that many researchers face the dilemma of selling their discoveries to third-party brokers who may not immediately report the flaws or find other nefarious uses for the zero-day vulnerabilities. He says that while working on his Apport research, he was offered $10,000 for his exploits by an unnamed third party.

"To improve security for everyone we need to find sustainable ways to incentivize researchers to find and disclose issues and to get bugs fixed," said O'Caerbhaill.

"We can’t and we shouldn’t rely on researchers giving away their work for free to for-profit vendors. We will not get security like that."

Meanwhile, the Ubuntu team has fixed its software, which is available now to download and install via the usual update mechanism. ®