CAPEC-14 - Client-side Injection-induced Buffer Overflow

This type of attack exploits a buffer overflow vulnerability in targeted client software through injection of malicious content from a custom-built hostile service.






  • Attack Methods 2
  • API Abuse
  • Injection
  • Purposes 1
  • Penetration
  • Sec Principles 2
  • Reluctance to Trust
  • Defense in Depth
  • Scopes 4
  • Read memory
  • Confidentiality
  • Modify memory
  • Integrity
  • DoS: resource consumption (memory)
  • Availability
  • Execute unauthorized code or commands
  • Availability
  • Integrity
  • Confidentiality

Low level: To achieve a denial of service, an attacker can simply overflow a buffer by inserting a long string into an attacker-modifiable injection vector.

High level: Exploiting a buffer overflow to inject malicious code into the stack of a software system or even the heap requires a more in-depth knowledge and higher skill level.

The targeted client software communicates with an external server.

The targeted client software has a buffer overflow vulnerability.

The server may look like a valid server, but in reality it may be a hostile server aimed at fooling the client software. For instance the server can use honey pots and get the client to download malicious code.

Once engaged with the client, the hostile server may attempt to scan the client's host for open ports and potential vulnerabilities in the client software.

The hostile server may also attempt to install and run malicious code on the client software. That malicious code can be used to scan the client software for buffer overflow.

Step 1 -

The attacker creates a custom hostile service.

Step 2 -

The attacker acquires information about the kind of client attaching to her hostile service to determine if it contains an exploitable buffer overflow vulnerability..

Step 1 -

The attacker intentionally feeds malicious data to the client to exploit the buffer overflow vulnerability that she has uncovered..

Step 2 -

The attacker leverages the exploit to execute arbitrary code or to cause a denial of service..

The client software should not install untrusted code from a non-authenticated server.

The client software should have the latest patches and should be audited for vulnerabilities before being used to communicate with potentially hostile servers.

Perform input validation for length of buffer inputs.

Use a language or compiler that performs automatic bounds checking.

Use an abstraction library to abstract away risky APIs. Not a complete solution.

Compiler-based canary mechanisms such as StackGuard, ProPolice and the Microsoft Visual Studio /GS flag. Unless this provides automatic bounds checking, it is not a complete solution.

Ensure all buffer uses are consistently bounds-checked.

Use OS-level preventative functionality. Not a complete solution.