---
title: "CAPEC-35: Leverage Executable Code in Non-Executable Files"
url: https://radicalnotion.ai/capec/capec-35
type: capec
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."
updated: 2026-06-01
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CAPEC-35: Leverage Executable Code in Non-Executable Files

- **Abstraction:** Detailed
- **Status:** Draft
- **Typical severity:** Very High
- **Likelihood of attack:** High
- **CAPEC catalog 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

## Resources required

- Ability to communicate synchronously or asynchronously with server that publishes an over-privileged directory, program, or interface. Optionally, ability to capture output directly through synchronous communication or other method such as FTP.

## Consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Confidentiality, Integrity, Availability | Execute Unauthorized Commands | Run Arbitrary Code |
| 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.

## Example instances

Virtually any system that relies on configuration files for runtime behavior is open to this attack vector. The configuration files are frequently stored in predictable locations, so an attacker that can fingerprint a server process such as a web server or database server can quickly identify the likely locale where the configuration is stored. And this is of course not limited to server processes. Unix shells rely on profile files to store environment variables, search paths for programs and so on. If the aliases are changed, then a standard Unix "cp" command can be rerouted to "rm" or other standard command so the user's intention is subverted.

The attack can be directed at a client system, such as causing buffer overrun through loading seemingly benign image files, as in Microsoft Security Bulletin MS04-028 where specially crafted JPEG files could cause a buffer overrun once loaded into the browser.

Another example targets clients reading pdf files. In this case the attacker simply appends javascript to the end of a legitimate url for a pdf (http://www.gnucitizen.org/blog/danger-danger-danger/) http://path/to/pdf/file.pdf#whatever\_name\_you\_want=javascript:your\_code\_here The client assumes that they are reading a pdf, but the attacker has modified the resource and loaded executable javascript into the client's browser process.

The attack can also target server processes. The attacker edits the resource or configuration file, for example a web.xml file used to configure security permissions for a J2EE app server, adding role name "public" grants all users with the public role the ability to use the administration functionality. \< security-constraint\> \<description\>Security processing rules for admin screens\</description\> \<url-pattern\>/admin/\*\</url-pattern\> \<http-method\>POST\</http-method\> \<http-method\>GET\</http-method\> \<auth-constraint\> \<role-name\>administrator\</role-name\> \<role-name\>public\</role-name\> \</auth-constraint\> \</security-constraint\> The server trusts its configuration file to be correct, but when they are manipulated, the attacker gains full control.

## Related weaknesses (CWE)

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

## Related attack patterns

| Relationship | CAPEC | Name |
| --- | --- | --- |
| Parent | [CAPEC-636](https://radicalnotion.ai/capec/capec-636) | Hiding Malicious Data or Code within Files |
| Peer | [CAPEC-23](https://radicalnotion.ai/capec/capec-23) | File Content Injection |
| Peer | [CAPEC-75](https://radicalnotion.ai/capec/capec-75) | Manipulating Writeable Configuration Files |

## Taxonomy mappings

| Taxonomy | Entry | Id |
| --- | --- | --- |
| ATTACK | Obfuscated Files or Information: HTML Smuggling | 1027.006 |
| ATTACK | Obfuscated Files or Information: Embedded Payloads | 1027.009 |
| ATTACK | Hide Artifacts: Resource Forking | 1564.009 |

## Frequently asked questions

### What is CAPEC-35?

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.

### How do you prevent CAPEC-35?

Design: Enforce principle of least privilege

### What weaknesses does CAPEC-35 target?

CAPEC-35 exploits 8 CWE weaknesses, including CWE-59 (Improper Link Resolution Before File Access), CWE-94 (Improper Control of Generation of Code), CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code) and CWE-96 (Improper Neutralization of Directives in Statically Saved Code).

### How severe is CAPEC-35?

MITRE rates CAPEC-35 as Very High severity with high likelihood of attack.

Primary source: [MITRE CAPEC](https://capec.mitre.org/data/definitions/35.html)

---

Source: [RadicalNotion.AI](https://radicalnotion.ai/capec/capec-35). Licensed CC BY-NC 4.0; attribute RadicalNotion.AI and link the source page when you reuse this data.
