Client-side Injection-induced Buffer Overflow |
Attack Pattern ID: 14 (Detailed Attack Pattern Completeness: Complete) | Typical Severity: High | Status: Draft |
Summary
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 Execution Flow
The attacker creates a custom hostile service
The attacker acquires information about the kind of client attaching to her hostile service to determine if it contains an exploitable buffer overflow vulnerability.
The attacker intentionally feeds malicious data to the client to exploit the buffer overflow vulnerability that she has uncovered.
The attacker leverages the exploit to execute arbitrary code or to cause a denial of service.
The targeted client software communicates with an external server.
The targeted client software has a buffer oveflow vulnerability.
Description
Authors often use <EMBED> tags in HTML documents. For example
If an attacker supplies an overly long path in the SRC= directive, the mshtml.dll component will suffer a buffer overflow. This is a standard example of content in a Web page being directed to exploit a faulty module in the system. There are potentially thousands of different ways data can propagate into a given system, thus these kinds of attacks will continue to be found in the wild.
Skill or Knowledge Level: Low
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 : 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 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.
An example of indicator is when the client software crashes after executing code downloaded from a hostile server.
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.
When the function returns control to the main program, it jumps to the return address portion of the stack frame. Unfortunately that return address may have been overwritten by the overflowed buffer and the address may contain a call to a privileged command or to malicious code.
CWE-ID | Weakness Name | Weakness Relationship Type |
---|---|---|
120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') | Targeted |
353 | Failure to Add Integrity Check Value | Targeted |
118 | Improper Access of Indexable Resource ('Range Error') | Targeted |
119 | Failure to Constrain Operations within the Bounds of a Memory Buffer | Targeted |
74 | Failure to Sanitize Data into a Different Plane ('Injection') | Targeted |
20 | Improper Input Validation | Targeted |
680 | Integer Overflow to Buffer Overflow | Targeted |
697 | Insufficient Comparison | Targeted |
713 | OWASP Top Ten 2007 Category A2 - Injection Flaws | Targeted |
Nature | Type | ID | Name | Description | View(s) this relationship pertains to |
---|---|---|---|---|---|
ChildOf | Attack Pattern | 8 | Buffer Overflow in an API Call | Mechanism of Attack1000 | |
ChildOf | Attack Pattern | 100 | Overflow Buffers | Mechanism of Attack (primary)1000 | |
CanFollow | Attack Pattern | 13 | Subverting Environment Variable Values | Mechanism of Attack1000 |
CWE - Buffer Errors
Submissions | ||||
---|---|---|---|---|
Submitter | Organization | Date | ||
G. Hoglund and G. McGraw. Exploiting Software: How to Break Code. Addison-Wesley, February 2004. | Cigital, Inc | 2007-03-01 |
Modifications | |||||
---|---|---|---|---|---|
Modifier | Organization | Date | Comments | ||
Eric Dalci | Cigital, Inc | 2007-02-13 | Fleshed out content to CAPEC schema from the original descriptions in "Exploiting Software" | ||
Sean Barnum | Cigital, Inc | 2007-03-05 | Review and revise | ||
Richard Struse | VOXEM, Inc | 2007-03-26 | Review and feedback leading to changes in Related Attack Patterns | ||
Sean Barnum | Cigital, Inc | 2007-04-13 | Modified pattern content according to review and feedback |