Algorithmic compexity attacks
[Posted June 3, 2003 by corbet]
Scott Crosby and Dan Wallach have
announced
a paper describing a new class of security problem that they call
"algorithmic complexity attacks." The basic idea is simple: predictable
behavior in certain application algorithms can be exploited by attackers to
create denial of service problems; these attacks can be easy to mount and
require very low amounts of bandwidth. The
full
paper describes this sort of attack in detail, with a strong emphasis
on hash tables. The authors promote a particular class of hashing
algorithm ("universal hash") as a way of fixing the problem.
The networking hash
vulnerability described here two weeks ago clearly falls into this
category of problem. (This vulnerability, incidentally, is still unfixed
by any distributors beyond Red Hat and EnGarde). Mr. Crosby has also found
a similar problem in the Linux kernel
directory entry cache code; an attacker who has control over file names can
force behavior which slows the system to a crawl.
The interesting thing is that, once one starts looking, this sort of
vulnerability is widespread. For example:
- Languages like Perl and Python provide hashed data structures
(associative arrays and dictionaries). If an application uses user
input as a key for such a structure, that application can be
vulnerable to attack. The paper demonstrates the degree to which Perl
arrays can degrade with carefully chosen input.
- Regular expressions are widely used in applications. Anybody who
has programmed with non-trivial regular expressions knows that they
can be hard to get right in the first place. But writing regular
expressions which do not bring the application down in flames when
confronted with the wrong input is even harder.
Chances are many applications suffer from this sort of vulnerability. It
may soon be that distributed denial of service attacks pass out of favor;
if an algorithmic complexity attack is available, there is no real point in
going to the effort of assembling the attack network.
Sadly, it may well turn out that free software applications are uniquely
vulnerable to algorithmic complexity attacks - at least, in the short term.
Mounting such an attack requires a reasonably well advanced understanding
of which algorithms an application is using, and how it is using them.
Closed-source applications will certainly have (at least) as many
algorithmic complexity vulnerabilities as free applications, but the lack
of source will make those vulnerabilities hard to exploit. In the longer
term, of course, the situation may reverse itself; the vulnerabilities in
free programs will have been found and fixed, while those in proprietary
code lurk on, waiting for an exploit to be developed.
(
Log in to post comments)