CAPEC-35
Leverage Executable Code in Non-Executable Files
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.
On this page
Ask an AI about this attack pattern
Show the prompt
Explain the attack pattern CAPEC-35: Leverage Executable Code in Non-Executable Files: how it unfolds, what it needs and how to prevent and detect it in my systems. Use https://capec.mitre.org/data/definitions/35.html and https://cve.bz/cve/capec/35?via=ask-ai-copy, which lists recent CVEs with the weaknesses it exploits. Cite the sources.Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this attack pattern's id and public links.
Prerequisites
The attacker must have the ability to modify non-executable files consumed by the target software.
Skills required
- Low skill
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
| Impact | Affects | Note |
|---|---|---|
| Execute Unauthorized Commands | Confidentiality, Integrity, Availability | Run Arbitrary Code |
| Modify Data | Integrity | |
| Gain Privileges | Confidentiality, Access Control, Authorization |
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.
Weaknesses it exploits
- 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
- CWE-96 Improper Neutralization of Directives in Statically Saved Code
- CWE-97 Improper Neutralization of Server-Side Includes (SSI) Within a Web Page
- CWE-270 Privilege Context Switching Error
- CWE-272 Least Privilege Violation
- CWE-282 Improper Ownership Management
Recent CVEs with these weaknesses
- 2.0CVE-2026-140057
A vulnerability was detected in yangzongzhuan RuoYi up to 4.8.3. The impacted element is an unknown function of the file ruoyi-admin/src/main/resources/templates/system/menu/menu.html of the component Menu Management. The manipulation of t…
- 2.0CVE-2026-140056
A security vulnerability has been detected in yangzongzhuan RuoYi up to 4.8.3. The affected element is the function menuItem of the file ruoyi-admin/src/main/resources/static/ruoyi/index.js of the component Menu Management Sidebar Tab Rend…
- 3.8CVE-2026-121477
A flaw was found in openpgp-cert-d. When reading a certificate, the component opens and reads the certificate file without verifying whether it is a symbolic link. In an environment where a certificate directory is shared between users, a …
- 3.8CVE-2026-121476
A flaw was found in openpgp-cert-d. When updating a certificate, the application opens the certificate file for writing without checking for symbolic links (symlinks). In environments where a certificate directory is shared between users, …
- 3.8CVE-2026-121475
A flaw was found in openpgp-cert-d. When acquiring a write lock, the application opens and truncates the lock file without verifying whether it is a symbolic link (a reference pointing to another file). In environments where a certificate …
- 3.3CVE-2026-121474
A flaw was found in sequoia-net. When inserting a certificate into a Web Key Directory (WKD) or creating a policy file, the application opens and writes to destination files without checking for symbolic links. In environments where certif…
- 2.1CVE-2026-139858
A flaw has been found in Dromara Jpom up to 2.11.14. The impacted element is the function toIndex of the file IndexControl.java of the component Server Index Controller. This manipulation causes cross site scripting. Remote exploitation of…
- 2.1CVE-2026-139857
A vulnerability was detected in Dromara Jpom up to 2.11.14. The affected element is the function toIndex of the file modules/server/src/main/java/org/dromara/jpom/controller/IndexControl.java of the component Web Console. The manipulation …
The newest records naming one of them. Each weakness's page lists them all.
Related attack patterns
- Part of
- CAPEC-636 Hiding Malicious Data or Code within Files
Examples
Virtually any system that relies on configuration files for runtime behavior is open to this attack vector. T…
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 benig…
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…
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 examp…
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.
MITRE's words, unchanged: CAPEC-35 at MITRE. CAPEC is Copyright © 2007–2026, The MITRE Corporation, used under the CAPEC terms of use: “The MITRE Corporation (MITRE) hereby grants you a non-exclusive, royalty-free license to use Common Attack Pattern Enumeration and Classification (CAPEC™) for research, development, and commercial purposes. Any copy you make for such purposes is authorized provided that you reproduce MITRE’s copyright designation and this license in any such copy.” CAPEC and the CAPEC logo are trademarks of The MITRE Corporation. Credits. All attack patterns.