Attacchi da saturazione del buffer (buffer overflow) Ataques por profusão de tampão  (buffer overflow) Angriffe durch Pufferüberlauf (buffer overflow) Attaques par débordement de tampon (buffer overflow) Ataques por desbordamiento de búfer

Buffer overflow introduction

"Buffer overflow" (sometimes called buffer overrun) attacks are designed to trigger arbitrary code execution by a program by sending it more data than it is supposed to receive.

Programs that accept parameterized input data temporarily store them in a region of memory called a buffer). But some read functions, such as strcpy() functions from the C language, cannot manage this type of overflow and cause the application to crash, which can lead to arbitrary code execution and open access to the system.

The implementation of this type of attack is extremely complicated as it requires in-depth knowledge of program and processor architecture. However, there are various expoits capable of automating this type of attack and making it accessible to quasi-novices.

Operating principle

The operating principle of a buffer overflow is closely related to the architecture of the processor on which the vulnerable application is executed.

Data entered in an application are stored in random access memory in a region called a buffer. A correctly designed program should stipulate a maximum size for input data and make sure the input data do not exceed this value.

The instructions and data of a running program are temporarily stored adjacently in memory in a region called a stack). The data located after the buffer contain a return address (called an instruction pointer) that lets the program continue its run-time. If the size of the data is greater than the size of the buffer, the return address is overwritten and the program will read an invalid memory address generating a segmentation fault in the application.

A hacker with strong technical knowledge can make sure the overwritten memory address corresponds to an actual address, for example located in the buffer itself. As such, by writing instructions in the buffer (arbitrary code), it is easy for him to execute it.

It is therefore possible to include instructions in the buffer that open a command interpreter (a shell) and make it possible for the hacker to take control of the system. This arbitrary code that makes it possible to execute the shell is called a shellcode.

Protecting yourself from a Buffer overflow

To protect yourself from this type of attack, it is important to develop applications using advanced programming languages, guaranteeing precise management of allocated memory, or using low level language with secure function libraries (for example, strncpy() functions).

Alert bulletins are published on a regular basis, announcing certain applications' vulnerability to buff overflow attacks. After the appearance of these alert bulletins, software publishers affected by the vulnerability generally publish patchs that can correct the flaw. All system and network adminstrators should keep informed of security alerts and apply patches as quickly as possible.

More information



Last update on Thursday October 16, 2008 02:43:15 PM.This document entitled « Buffer overflow attacks » from Kioskea (en.kioskea.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the licence, as this note appears clearly.
Best answers for « Buffer overflow attacks » in :
Teardrop attack Show Fragment attack A "fragment attack" is a network saturation (denial-of-service) attack that exploits the fragmentation principle of the IP protocol. The IP protocol is used to fragment large packets into several IP packets each having a sequence...
Nuke attack Show Nuke attack Nukes are Window crashes caused by dimwitted users (who know your IP address) who decide to use a Windows 95 (not 98) bug where if someone repeatedly sends information packets to port 139, Windows displays a lovely and impressive blue...
Ping of death attack Show Ping of death attack The ping of death attack is one of the oldest network attacks. The principle of ping of death simply involves creating an IP datagram whose total size exceeds the maximum authorized size (65,536 bytes). When such a packet is...
Buffer underrun ShowBuffer underrun It may happen that when you are burning a CD or DVD, that you are prompted by the buffer underun error message. This is due to the fact that your CD/DVD burner will continuously write data during the burn process, thus...
How to increase the cache on your hard disk? ShowHow to increase the cache on your hard disk? A cache is a temporarily area of storage storing fequently accessed data for quick access. It is a very efficient tools used under windows vista and windows xp which is set as default under...
Save the IP address of visitors of your site ShowSave the IP address of visitors of your site Record the IP address of visitors to your site If you are a victim of an attack or an attempted hack, it may be useful to know who connected on the pages of your site at sepecific...
Download Clean Virus MSN ShowViruses meet hereafter a bit on the net by all thinkable means everywhere. After mails , supporting they attack instantaneous freight forwarding. Clean Virus MSN is a tool which discerns automatically the viruses which circulate on MSN Messenger....
Download Blink Personal Edition ShowWith the spread of numerous viruses and other spywares on the Web and other interfaces, it is more careful to take all possible protection. Blink Personal Edition is a program allowing to reduce risks of exhibition to the various attacks which can...
Web server attacks ShowVulnerability of web services The first network attacks exploited vulnerabilities related to the implementation of TCP/IP protocol suites. With the gradual correction of these vulnerabilities, attacks have shifted to application layers and...
Denial of service attack ShowIntroduction to denial-of-service attacks A "denial-of-service attack" (abbreviated DoS) is a type of attack that aims to make an organization's services or resources unavailable for an indefinite amount of time. Most of the time, these attacks are...
Cross-Site Scripting attacks ShowMalicious code injection Cross-Site Scripting (sometimes abbreviated XSS or CSS) attacks are attacks targeting websites that dynamically display user content without checking and encoding the information entered by users. Cross-Site Scripting...