CAPECattack pattern

CAPEC-35 Leverage Executable Code in Non-Executable Files

Very High Official page ↗
Abstraction
Detailed
Status
Draft
Likelihood of attack
High
Typical severity
Very High
CAPEC version
3.9

Description

An attack of this type exploits a system's trust in configuration and resource files. When the executable loads the resource (such as an image file or configuration file) the attacker has modified the file to either execute malicious code directly or manipulate the target process (e.g. application server) to execute based on the malicious configuration parameters. Since systems are increasingly interrelated mashing up resources from local and remote sources the possibility of this attack occurring is high.

Prerequisites

• The attacker must have the ability to modify non-executable files consumed by the target software.

Skills required

• [Low] To identify and execute against an over-privileged system interface

Consequences

• Confidentiality, Integrity, Availability: Execute Unauthorized Commands • Integrity: Modify Data • Confidentiality, Access Control, Authorization: Gain Privileges

Mitigations

• Design: Enforce principle of least privilege • Design: Run server interfaces with a non-root account and/or utilize chroot jails or other configuration techniques to constrain privileges even if attacker gains some limited access to commands. • Implementation: Perform testing such as pen-testing and vulnerability scanning to identify directories, programs, and interfaces that grant direct access to executables. • Implementation: Implement host integrity monitoring to detect any unwanted altering of configuration files. • Implementation: Ensure that files that are not required to execute, such as configuration files, are not over-privileged, i.e. not allowed to execute.

Related

Att&ck technique · MITRE ATT&CK (3)

Child of · CAPEC (1)

  • CAPEC-636 Hiding Malicious Data or Code within Files attack pattern

Peer of · CAPEC (2)

  • CAPEC-23 File Content Injection attack pattern
  • CAPEC-75 Manipulating Writeable Configuration Files attack pattern

Weakness · CWE (8)

  • CWE-270 Privilege Context Switching Error weakness
  • CWE-272 Least Privilege Violation weakness
  • CWE-282 Improper Ownership Management weakness
  • CWE-59 Improper Link Resolution Before File Access weakness
  • CWE-94 Improper Control of Generation of Code weakness
  • CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code weakness
  • CWE-96 Improper Neutralization of Directives in Statically Saved Code weakness
  • CWE-97 Improper Neutralization of Server-Side Includes (SSI) Within a Web Page weakness

Referenced by CWE · attack pattern (8)

  • CWE-270 Privilege Context Switching Error weakness
  • CWE-272 Least Privilege Violation weakness
  • CWE-282 Improper Ownership Management weakness
  • CWE-59 Improper Link Resolution Before File Access weakness
  • CWE-94 Improper Control of Generation of Code weakness
  • CWE-95 Improper Neutralization of Directives in Dynamically Evaluated Code weakness
  • CWE-96 Improper Neutralization of Directives in Statically Saved Code weakness
  • CWE-97 Improper Neutralization of Server-Side Includes (SSI) Within a Web Page weakness