Feeds

What does C have in common with a scalding cup of coffee?

Security's Brewing Mess

  • alert
  • submit to reddit

Choosing a cloud hosting partner with confidence

Opinion In 1992, a seventy-nine year old woman sued the McDonald's fast food chain after spilling the entire contents of a cup of coffee in her lap, causing third-degree burns over six percent of her body. Several days in the hospital, intense medical treatments, and a jury trial later, the woman won her case and a $2.7 million dollar judgment, ultimately reduced to $480,000.

Some people jeered at the case, calling it a wanton abuse of the legal system. Others jumped on the bandwagon, finding a lawyer that would sue for whatever circumstance they could find. To this day, whenever the McDonald's coffee case comes up in conversation, people still scoff and joke about it.

The fact of the matter is, the woman was seriously injured. If you fill a paper cup with 185 degree Fahrenheit liquid, cap it with a plastic top and hand it to a senior citizen in a car, you have to assume some responsibility for the outcome.

The most popular programming languages are like that scalding cup of coffee. Accidents in programming will happen, and we can't blame programmers for occasionally getting burned.

Today's programmers are still writing code the same way their predecessors did, using the same languages. A good example is C, a robust, excellent language filled with power and features, that hasn't evolved much since the 70s.

This is silly. I'm not saying the lack of C evolution is a bad thing: when we consider that the language was originally designed for writing UNIX, it has served its purpose more than well. It has advantages in portability over lower-level languages such as assembly, and benefits of speed over higher-level languages. It is a useful tool, and will continue to be useful for many years to come.

But the trade-offs are significant, and we can no longer afford to ignore them. As we've seen again and again, the language makes buffer overflows, and other security holes, far too easy to inadvertently code into a program.

Even the developers of the "secure" operating system suffer with C's faults. Theo and crew continually fix bugs in OpenSSH that result from subtle programming errors. And once they're all "fixed," people with talent for finding bugs, such as Solar Designer, look through the code and the floodgates open again.

Meanwhile, most applications written in C today don't even benefit from the language's strengths.

Consider, for example, a chat client that needs low-level system access or memory management. Can you name one? If it is possible to rewrite chat clients using high-level languages like Java, HTML, and even PERL, we should do it. As it is, we're continually seeing buffer overflow and format string vulnerabilities reported in everything from AIM to mIRC; Epic to MSN Messenger.

Generation Java

How about Web servers? They generally require only one feature: to run fast. However, looking at the 1.3.29 release of the Apache Web Server (which, incidentally, was publicly released on October 28th of 2003 because of buffer overflows in two separate modules), there are over five megabytes of code in the Apache source directory! I say the odds are pretty high that not all the problems have been found and fixed. And as we all know, other Web servers on other platforms fare no better.

That's why I like Java. Java offers all the benefits of a high-level language such as portability and object-oriented design, while it also provides some features similar to lower-level languages, such as byte-compiled code. It's highly portable, and it's supported across multiple platforms and architectures. It has all the makings of a panacea.

Most importantly, security has been a huge consideration in Java's design, with a security manager built into the Java Virtual Machine. The language removes memory management from the programmer's responsibilities, eliminating buffer overflows, memory corruption, and format string vulnerabilities. This design choice alone obliterates the most common cause of catastrophic software vulnerabilities in programs from chat clients to Web servers.

For programs that will encounter contact with malicious users, Java appears to be a great language to use.

But Java isn't without it's own security problems. Time and time again, we have seen vulnerabilities arise in Java that cause the entire security model to crumble. The most recent was reported last week, though it got little press, when the Last Stage Of Delirium reported a vulnerability in Sun's Java Virtual Machine that makes it possible to circumvent the security manager's checking of classes in applets when the class is invoked using slashes between sub-class names, rather than the traditional dots. The problem could potentially lead to applets loading classes outside of the "sandbox" that limits the class's influence. It's a disaster in the making: should somebody write a worm, it could move across different operating systems and architectures.

Problems like this are gravely serious, but they can be fixed in the implementation. The security problems in C and similar languages are endemic.

Programmers must evolve to writing applications in higher programming languages. It is time we face the reality that applications can't be safely written in lower languages. But be it Java, or something else, the shift must be to a language that is safer than a cup of McDonald's coffee. Lest we all get burned.

Copyright ©

Author and security analyst Hal Flynn manages the SecurityFocus UNIX focus area.

Secure remote control for conventional and virtual desktops

More from The Register

next story
Netscape Navigator - the browser that started it all - turns 20
It was 20 years ago today, Marc Andreeesen taught the band to play
Sway: Microsoft's new Office app doesn't have an Undo function
Content aggregation, meet the workplace ... oh
Sign off my IT project or I’ll PHONE your MUM
Honestly, it’s a piece of piss
Return of the Jedi – Apache reclaims web server crown
.london, .hamburg and .公司 - that's .com in Chinese - storm the web server charts
NetWare sales revive in China thanks to that man Snowden
If it ain't Microsoft, it's in fashion behind the Great Firewall
Chrome 38's new HTML tag support makes fatties FIT and SKINNIER
First browser to protect networks' bandwith using official spec
Admins! Never mind POODLE, there're NEW OpenSSL bugs to splat
Four new patches for open-source crypto libraries
prev story

Whitepapers

Forging a new future with identity relationship management
Learn about ForgeRock's next generation IRM platform and how it is designed to empower CEOS's and enterprises to engage with consumers.
Cloud and hybrid-cloud data protection for VMware
Learn how quick and easy it is to configure backups and perform restores for VMware environments.
Three 1TB solid state scorchers up for grabs
Big SSDs can be expensive but think big and think free because you could be the lucky winner of one of three 1TB Samsung SSD 840 EVO drives that we’re giving away worth over £300 apiece.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Security for virtualized datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.