| Home > CAPEC List > CAPEC-67: String Format Overflow in syslog() (Version 3.9) |
|
High
Very High
| Nature | Type | ID | Name |
|---|---|---|---|
| ChildOf | Standard Attack PatternStandard Attack Pattern - A standard level attack pattern in CAPEC is focused on a specific methodology or technique used in an attack. It is often seen as a singular piece of a fully executed attack. A standard attack pattern is meant to provide sufficient details to understand the specific technique and how it attempts to accomplish a desired goal. A standard level attack pattern is a specific type of a more abstract meta level attack pattern. | 100 | Overflow Buffers |
| ChildOf | Standard Attack PatternStandard Attack Pattern - A standard level attack pattern in CAPEC is focused on a specific methodology or technique used in an attack. It is often seen as a singular piece of a fully executed attack. A standard attack pattern is meant to provide sufficient details to understand the specific technique and how it attempts to accomplish a desired goal. A standard level attack pattern is a specific type of a more abstract meta level attack pattern. | 135 | Format String Injection |
| CanFollow | Standard Attack PatternStandard Attack Pattern - A standard level attack pattern in CAPEC is focused on a specific methodology or technique used in an attack. It is often seen as a singular piece of a fully executed attack. A standard attack pattern is meant to provide sufficient details to understand the specific technique and how it attempts to accomplish a desired goal. A standard level attack pattern is a specific type of a more abstract meta level attack pattern. | 69 | Target Programs with Elevated Privileges |
| View Name | Top Level Categories |
|---|---|
| Domains of Attack | Software |
| Mechanisms of Attack | Manipulate Data Structures, Inject Unexpected Items |
Identify target application: The adversary identifies a target application or program to perform the buffer overflow on. In this attack, adversaries look for applications that use syslog() incorrectly.
Find injection vector: The adversary identifies an injection vector to deliver the excessive content to the targeted application's buffer. For each user-controllable input that the adversary suspects is vulnerable to format string injection, attempt to inject formatting characters such as %n, %s, etc.. The goal is to manipulate the string creation using these formatting characters.
| Techniques |
|---|
| Inject probe payload which contains formatting characters (%s, %d, %n, etc.) through input parameters. |
Craft overflow content: The adversary crafts the content to be injected. If the intent is to simply cause the software to crash, the content need only consist of an excessive quantity of random data. If the intent is to leverage the overflow for execution of arbitrary code, the adversary will craft a set of content that not only overflows the targeted buffer but does so in such a way that the overwritten return address is replaced with one of the adversaries' choosing which points to code injected by the adversary.
| Techniques |
|---|
| The formatting characters %s and %d are useful for observing memory and trying to print memory addresses. If an adversary has access to the log being written to they can observer this output and use it to help craft their attack. |
| The formatting character %n is useful for adding extra data onto the buffer. |
Overflow the buffer: Using the injection vector, the adversary supplies the program with the crafted format string injection, causing a buffer.
| Scope | Impact | Likelihood |
|---|---|---|
Confidentiality Integrity Availability | Execute Unauthorized Commands | |
Availability | Unreliable Execution | |
Confidentiality Access Control Authorization | Gain Privileges | |
Integrity | Modify Data |
The code should be reviewed for misuse of the Syslog function call. Manual or automated code review can be used. The reviewer needs to ensure that all format string functions are passed a static string which cannot be controlled by the user and that the proper number of arguments are always sent to that function as well. If at all possible, do not use the %n operator in format strings. The following code shows a correct usage of Syslog():
The following code shows a vulnerable usage of Syslog():
| CWE-ID | Weakness Name |
|---|---|
| 120 | Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') |
| 134 | Use of Externally-Controlled Format String |
| 74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') |
| 20 | Improper Input Validation |
| 680 | Integer Overflow to Buffer Overflow |
| 697 | Incorrect Comparison |
| Entry ID | Entry Name |
|---|---|
| 06 | Format String |
| Submissions | ||
|---|---|---|
| Submission Date | Submitter | Organization |
| 2014年06月23日 (Version 2.6) | CAPEC Content Team | The MITRE Corporation |
| Modifications | ||
| Modification Date | Modifier | Organization |
| 2017年01月09日 (Version 2.9) | CAPEC Content Team | The MITRE Corporation |
| Updated Related_Attack_Patterns | ||
| 2018年07月31日 (Version 2.12) | CAPEC Content Team | The MITRE Corporation |
| Updated References | ||
| 2020年07月30日 (Version 3.3) | CAPEC Content Team | The MITRE Corporation |
| Updated Execution_Flow | ||
| 2020年12月17日 (Version 3.4) | CAPEC Content Team | The MITRE Corporation |
| Updated Taxonomy_Mappings | ||
| 2021年10月21日 (Version 3.6) | CAPEC Content Team | The MITRE Corporation |
| Updated Description, Execution_Flow, Prerequisites, Related_Attack_Patterns | ||
| 2022年02月22日 (Version 3.7) | CAPEC Content Team | The MITRE Corporation |
| Updated Example_Instances | ||
| 2022年09月29日 (Version 3.8) | CAPEC Content Team | The MITRE Corporation |
| Updated Mitigations | ||
|
Use of the Common Attack Pattern Enumeration and Classification (CAPEC), and the associated references from this website are subject to the Terms of Use. Copyright © 2007–2025, The MITRE Corporation. CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. |
||