Code Zombies

February 22nd, 2012

[This post was inspired by a discussion last week in my "Biological Approaches to Computer Security" class.]

Let’s talk about living code and dead code.

Living code is code which can change and evolve in response to new requirements.  Living code is a communications medium between the programmers of the past and those of the present.  Together, they collaborate on specifying solutions to software problems.  The more alive the code, the more active this dialog.

Dead code*, in this context, is code that is not alive.  It does not change in response to new requirements.  Dead code is part of a conversation that ended long ago.  Some dead code is truly dead and buried.  The code for Windows 1.0 I would characterize as being dead in this way.  Other dead code, however, still walks the earth.

I call these entities code zombies.  Others call them legacy code.

Code zombies died a long time ago.  The programmer conversations they were part of have long ended, and nobody is left who can continue them from where they left off.  Nobody understands this code, and nobody can really change it without almost rewriting it from scratch.  Yet this code is still run, is still relied upon.

Look around you – you’re surrounded by code zombies.  If you run commercial, proprietary software, you are probably running a lot of zombie code.  If you run open source, there are many fewer zombies around – but they do pop their heads up every so often.

Enterprises devote huge resources to maintaining their zombies.  Zombies aren’t good at taking care of themselves, and the repair jobs are often gruesome.  Sometimes a zombie needs to be brought back to life.  This can be done, at great effort and expense.  The result, however, is Frankenstein code: it may live, but boy is it not pretty, and it may turn around and bite you.

And here’s a funny thing: zombie code is insecure code.  Tamed zombies aren’t fussy about who they take orders from.  Living code, however, is part of a community that works to keep it safe.

I predict that the software industry will transform once enough people realize the costs of keeping zombies around outweigh the benefits.

* I know”dead code” has other meanings in computer science.

The Expert Engineer’s Fallacy

September 14th, 2011

Today’s news was abuzz with yet another Google attempt to engineer a better Internet, this time in the form of a alternative to JavaScript. There’s been some interesting talk about how Google is doing just what Microsoft used to do, namely propose their own technologies as better alternatives to current practice.  One argument I saw basically says:

  • Google is attempting to replace all major web technologies with alternatives developed in-house.
  • Microsoft attempted to replace all major web technologies with alternatives developed in-house.
  • Microsoft is (or at least was) evil.
  • Google is now becoming evil.

(Sorry, can’t remember where I saw this.)  I think there is actually some truth to this argument, but it has nothing to do with being “evil.”  Rather, it is simply a symptom of having too many very good engineers all working together in the same environment.

Engineers always want to make better pieces of technology.  The better the engineer, the greater their ambition.  Get a bunch of them together in the same place, and they’ll try to remake the world in their image.

Unfortunately, at a certain scale their efforts are almost guaranteed to fail.  It isn’t because they aren’t good.  It is because they don’t know their limits.  And their limits are also simple to explain, but hard for many to believe.

We cannot engineer novel complex systems.  Full stop.

If something is very complicated and you’ve built one before, you can copy the past design and do a reasonable job – as long as you don’t change too many things.  If you are engineering something on a smaller scale, it is possible to design it from scratch and have it be quite good.  But once a system gets complicated enough, nobody understands the whole problem.  And if you don’t understand the whole problem, you can’t engineer a solution.

But we build big systems all the time, right?  Yes, we do, but what we do is engineer parts and then put them together in a process that is, more or less, trial and error.  We try things, we see what happens, and inevitably tweak/hack things to get them to work.

Google’s effort with Dash may succeed on its own in some niche.  But JavaScript as a platform is simply too big to just be replaced.  It is big and complex and solves more problems than any human – or even moderately-sized group of humans – understands.  We can compete with it, but we won’t be able to just engineer it away.   The rules of evolution now apply, not those of design.

Google is doing what Microsoft tried before simply because they are both places with engineers who don’t know their limits.  Well, Microsoft now knows its limits – it hit a wall, and is now a much more humble company.  Eventually this will happen to Google as well.

Such is the way of evolution.

War is the exception

August 17th, 2011

The imagery and terminology of war pervade computer security.  Intrusions, vulnerabilities, attackers, defenders – they are all militaristic.  While such terms may be be useful, that does not mean we should think we are at war on the Internet.  I say this for a very simple reason: war is always the exception.

Life as we know it is on pause when we are at war.  The rules that govern our productive lives – those that allow us to create, trade, and raise families – are all suspended when we are fighting for those lives.  The only good thing about war is its ending.  To be at war is to be fighting so we can be at peace.

This is what the computer security community must come to grips with: we are not at war today on the Internet.  If we were, then people would not be conducting business, socializing, learning, and falling in love online; instead, we would all be fighting for our (virtual) lives.

Now, it is true that in real war life does go on in some fashion; nevertheless, war is defined by fear, and this  fear infuses even the most mundane aspects of life.  While people are wary, they are not living in fear on the Internet.  We are at peace online.  And this is a good thing!

Why this matters in a computer security context is that what is appropriate for war is not appropriate for peacetime.  Arming the populace for cyber warfare can help prepare us for war; preparation for war, however, is often the surest way to destroy the peace.

Sacrifices that we willingly make in war are loathsome otherwise.  To forget this is to forget the greatest benefit of peace: the relative absence of fear.  Our job as computer security researchers and professionals should not be to spread fear, but rather to protect people from fear.

Our job is to keep the peace.

Going Beyond Social

June 28th, 2011

Today Google announced their Google+ initiative, their latest attempt to address the “social” phenomenon that is currently dominated by Facebook.  To the various observations being made across the Internet, I just wanted to add a small thought.

Humans evolved to socialize in relatively small groups – 200-300 is what I’ve heard.  Social media makes it oh so easy to interact with many, many more than this.  While connecting online with every person you’ve ever met might sound like a good idea, most of us quickly realize that we really cannot handle this level of social interaction.

I am currently connected with so many people on Facebook that I’d love to talk for hours with.  I have been blessed by having known many very interesting, good people in my life.  But the fact that I can interact with so many of them now just makes me shudder.  I simply don’t have the time!  And even just trying to keep up with their status updates is too much. As our online connectivity increases, I think we all are going to experience this social information overload.

Google is giving us a better Facebook.  What we need, though, is a cure to social information overload.

Mobile access

February 20th, 2011

I’ve just enabled a mobile theme for this site. Hopefully this will lead to more posts in the near future…

Statistical Mirages

March 3rd, 2010

I have to admit that I’ve always been suspicious of statistics as they are used in computer security.  Oddly enough, I also should have been suspicious of statistics in other sciences as well.  Turns out that when you examine large datasets with lots of tests, simply by random chance you are likely to find something, i.e., one of the tests is likely to come up with something “significant.”  Hence you get results that suggest breathing in bus exhaust is good for you.  In other words, you get false positives.

If anomaly detection is ever to become a fundamental defense technology, it will have to move beyond statistics to being grounded in the mechanisms of computers and the real behaviors of users.  This is going to take a while, because this is a lot harder than just running a bunch of tests on datasets.  Of course, given the current disrepute of anomaly detection in security circles, perhaps the door is wide open for better approaches.

RIGorous Cell-level Intrusion Detection

January 18th, 2010

When looking to biology for inspiration on computer security, it is natural to first look at mammalian immune systems.  While they are amazingly effective, they are also mind-numbingly complex.  As a result, many researchers get seduced by the immune system’s architecture when there is so much to learn from its lower-level workings.

Case in point: every cell in the human body can detect many kinds of viral infection on their own, i.e., with no assistance from the cells of the immune system.  As this recent article from Science shows, we are still far from understanding how such mechanisms actually work.  My high-level take on this article, as a computer security researcher, is that:

  • Basically all cells in mammals (and, I think, most animals in general) can generate immune system signals that generate responses from internal and external mechanisms.  A key source for such signals is foreign RNA (code) inside the cytoplasm of a cell.  Of course, there is a lot of other, “self”-RNA in that cytoplasm as well – so how does the cell tell the difference between them?
  • A key heuristic is that native RNA is only copied in the nucleus of a cell; RNA-based viruses, however, need to make RNA copies in the cytoplasm (that’s where they end up after getting injected and it isn’t easy to get into the nucleus – code basically only goes out, it hardly ever goes in).  RNA polymerases (RNA copiers) all use the same basic patterns to mark where copying should start.  Receptors such as RIG-I detect RNA with “copy me” signals (5′-PPP) in places where no copying should occur (the cytoplasm).
  • Of course, this is biology, so the picture isn’t so clear-cut.  A simple “copy me” signal won’t trigger a response; there must also be some base pairing – the RNA molecule must fold back on itself or be bound to another (partially complementary) RNA molecule.  I’d guess this additional constraint is there because normal messenger RNA is strictly single-stranded.   (Indeed, kinks or pairing in messenger RNA are bad in general because they’ll interfere with the creation of proteins.)

Of course, all of this is partial information – there’s evidence that these foreign RNA-detecting molecules (the RLR-family) trigger under other additional constraints.  This doesn’t surprise me either, as this mechanism must operate with extremely low false positives; one or two matching rules aren’t up to the task given the complexity of cellular machinery and (more importantly) given the evolution of viruses to circumvent these protections.  Viruses have evolved ways to shutdown or suppress RLR-related receptors.  Although cells will be pushed to evolve anti-circumvention mechanisms, in practice this is limited in the cellular environment—make the detectors too sensitive and a cell will kill itself spontaneously!  The solution has been to keep a circumventable but highly accurate detector in place; the arms race instead has moved to optimizing the larger immune system.

I leave any conclusions regarding the design of computer defenses as an exercise for the reader. :-)

Industrial policy vs. currency devaluation

January 9th, 2010

Over the past year I find myself reading more and more economics-probably because I know sol little about the field.  Anyway, I have to say I found this paper by Dani Rodrik (which I found via Brad Delong) to be fascinating.  I knew that currency devaluation was a big factor in China’s huge currency reserves and their trade surplus; I never thought to link that to them joining the WTO and abandoning targeted industrial policy.  This makes me think that something major has to change with respect to China and the rest of the world.  They are following the rules as best they can given their domestic constraints, but those choices are having major external repercussions.  So then the question is, how is anyone going to change the rules, and do so in a way that everyone can agree to?

I suspect climate change will figure into this as well.  Wow, what a mess.  Makes me glad I’m not a politician…

DNSSEC and the Financial Meltdown

November 21st, 2009

This week in our group meeting Alex gave a presentation about the status of DNSSEC.  DNSSEC is supposed to improve the security of the Domain Name System (DNS) by cryptographically signing DNS responses.  Thus, with DNSSEC, you can be sure that when you visit www.google.com, you are visiting a machine (IP address) that is actually associated with Google, rather than visiting some random attacker’s website.  Recently a number of DNS vulnerabilities have been found that make it very easy (under some circumstances) to forge DNS responses, so the security case for DNSSEC would appear to be very strong.  By the end of our discussion, however, we had reached a very different conclusion.  Let me explain.

First, let’s assume that DNSSEC is adopted in record time, say within the next year – 95%+ penetration on secured servers and clients.  Next, let’s assume that all the major security problems with DNSSEC – such as the lack of key revocation – have been resolved.  In this hypothetical world, we would now have a DNS infrastructure hardened against forgery attacks.  Mission accomplished, right?  Maybe not.  In fact, I think there’s a good chance that we would actually be in worse shape than we are now.  Things would be worse because the Internet would become both less reliable and less secure.  These problems would arise precisely because of the success of DNSSEC.

The key insight is that a successful DNSSEC would inevitably kill SSL certificates; instead, SSL would just use the keys conveyed by DNSSEC.  Why bother maintaining two sets of cryptographic credentials when you can get away with one?  Once this happens, the incentives for breaking DNSSEC become enormous.

And break it they will, because DNS admins at all levels have minimal experience safeguarding cryptographic credentials – they know how to keep servers running, not how to keep secrets.  The first priority with DNS will always be availability, and such availability in DNS means that entries have to be changed with short notice.  Therefore, many more people will have access to domain signing keys than should from a security perspective.  Thus, attackers will get the keys.  And those keys will be trusted even more than SSL certificates, because they will be used to block network connections.

So, in an effort to secure DNS, we will make DNS less reliable (because it will be harder to make timely updates) and we’ll make the Internet less secure (because connections to secure websites will be authenticated using much less reliable signatures).

We currently have some faith in cryptographic credentials because they are issued by parties that value their reputation for security (because their business depends upon it).  Instead, we’re going to make organizations who have a reputation for reliability – DNS registrars – and we’re going to give them a fundamental security responsibility that detracts from their core mission of reliability.  The parties implementing DNSSEC actually have significant incentives to trade off security for reliability, even though everybody else on the Internet will have an increasing requirement that DNS be secure (because it will replace SSL certificates).

So, what’s the connection to the financial meltdown?  Well, that meltdown can be, in part, attributed to mismatches between incentives and expectations of trustworthiness.  Credit rating agencies were expected to look out for buyers of securities but were paid by the sellers of securities.  Developers of mortgage-backed securities expected banks to continue to make loans as they had in the past, even though mortgage-backed securities gave banks every incentive to be careless when giving out loans – if the loans went bad, they wouldn’t lose any money because they’d sold the loan to somebody else!

New technologies, whether DNSSEC or financial securitization, inevitably have secondary effects on human decision making.  Technologists must realize that tools designed to increase security or manage risk can, in practice, lead to reduced security or disastrous levels of risk.

everyone in the financial world having too much faith in the models underlying structured financial instruments (such as mortgage-backed securities).  Those models became untrustworthy the moment they were used to create structured financial instruments, because such instruments removed the incentives for banks to be careful when giving out loans (they no longer faced the risk of mortgage defaults).

In our discussion, Luc made an interesting point that reliability and security are generally in conflict in practice, but yet system designers seem to keep wanting to do both at the same time.  I think there’s a deep insight here, but I’m not quite sure what it is.  All I do know is that if we’re going to get reliability and security, we need more flexible ways to manage the trade-offs between them.


Switch to our mobile site