Buffer Overflow Attacks: Methods and Best Practices
LevelBlue Completes Acquisition of Cybereason. Learn more
Get access to immediate incident response assistance.
Get access to immediate incident response assistance.
LevelBlue Completes Acquisition of Cybereason. Learn more
One of the best ways to improve IT security is for security specialists to understand, at a fundamental level, how different kinds of exploits work. They tend to fall into clusters, based on certain core ideas.
Among the most common forms, for instance, is buffer overflow attacks. The root idea is fairly simple: by inserting more data into a memory buffer than is supposed to be there, an attacker can cause a program to act in unexpected ways that support the attacker’s agenda.
A variety of results can emerge from buffer overflow attacks, ranging from an exception-driven crash to something much more sinister like executing rogue code inserted into computer memory by the attacker. Once this new code is running, it then becomes possible to achieve outcomes like corrupting enterprise data, monitoring and stealing private information, slowing performance of key systems, and many others.
Buffer overflow attacks are far from new to IT security. They’ve been around at least since the 1988 Morris worm, which rapidly spread across the Internet by taking advantage of problematic coding in the UNIX finger daemon. And they all rely on the same, basic premise of problematic coding pertaining to the boundaries of data structures. If the code assumes data can only possibly be of a certain length, an attacker need only exceed that length to cause problems.
You might wonder why programming languages don’t take buffer overflow attacks into account in their basic design, by enforcing rigorous boundary management at compile time. Many do, but they tend to be relatively recent languages such as Java. Older and more established languages, in particular C and its object-oriented cousin C++, as a rule do not — and they also have tremendous momentum in the development world. These languages have for decades been routinely leveraged to create some of the most fundamental elements of modern IT infrastructures, such as the operating systems Linux, UNIX, Windows, and Mac OS X, as well as a wide variety of applications and middleware.
So the unfortunate reality is that buffer overflow attacks, as a class of security threat, are not likely to go away any time soon. It’s just a question of how well security professionals can proactively address the problem or deal with it when it arises in a new form.
Let’s take a look at some of the different types of buffer overflow attacks.
With that in mind, we can now consider some of the best ways this attack vector can be addressed by security professionals.
Clearly, the best possible opportunity is in the case of code that is actually written in-house, by a development team. Either they, or the quality assurance group, can discover buffer overflow attack possibilities by using automated testing tools or making an aggressive attempt to input unexpected data of inappropriate length during testing.
Also, of course, development teams aren’t limited to C! In fact, safe and automatic memory management, in which buffer boundaries can’t be overrun in these ways, is one of the primary strengths of languages such as Java, Rust (endorsed by Mozilla), and virtually all scripting languages such as Python, Perl, and others.
In the case of code developed externally (such as operating systems and “commercial off-the-shelf” applications), it’s also possible to do endpoint vulnerability scans looking for known buffer overflow attacks (usually associated with older, unpatched versions) that can be compromised with known malware. Similarly, intrusion detection systems can also be updated with rules that look for the behavior of systems that have already been compromised via known exploits. Security administrators can even block outright any attempt to access IP addresses or ranges associated with “bad actors” (eg, criminal organizations located in high-risk locations) from which such attacks often emerge.
The bottom line is that buffer overflow attacks are, and will remain, a primary concern for IT security. Criminal organizations and hackers are increasingly sophisticated in the ways they find and exploit vulnerabilities, and C and C++ continue to be extremely popular as development languages for perceived performance reasons.
So while organizations can try to apply pressure to in-house and external developers (to use better memory management practices and/or languages other than C and C++), the reality is that we can expect ongoing exploits in this area for the foreseeable future
LevelBlue is a globally recognized cybersecurity leader that reduces cyber risk and fortifies organizations against disruptive and damaging cyber threats. Our comprehensive offensive and defensive cybersecurity portfolio detects what others cannot, responds with greater speed and effectiveness, optimizes client investment, and improves security resilience. Learn more about us.