CWE-829 / WEAKNESS
Inclusion of Functionality from Untrusted Control Sphere
The product imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.
- Category
- CWE weaknesses
- Version / scope
- CWE 5.0; release 2026-10-28; publisher status Incomplete
- Affected / relevant technologies
- Not Language-Specific
- Evidence
- Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.
Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.
Mechanism and prerequisites
Review publisher context and local applicability; this reference is not execution evidence.
Potential impact
Confidentiality Integrity Availability Execute Unauthorized Code or Commands An attacker could insert malicious functionality into the program by causing the program to download code that the attacker has placed into the untrusted control sphere, such as a malicious web site. This could enable the injection of malware, information exposure by granting excessive privileges or permissions to the untrusted functionality, DOM-based XSS vulnerabilities, stealing user's cookies, open redirect to malware (CWE-601), etc.
Versioned source scope
This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.
Publisher: MITRE. Release: CWE 5.0. Source checked: 2026-11-26.
Source object: CWE-829. Object modified: 2026-01-21.
Attribution and source terms (© The MITRE Corporation; reproduced with permission)Detection and investigation
- Automated Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Bytecode Weakness Analysis - including disassembler + source code weakness analysis SOAR Partial
- Manual Static Analysis - Binary or Bytecode According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies SOAR Partial
- Dynamic Analysis with Manual Results Interpretation According to SOAR [REF-1479], the following detection techniques may be useful: Cost effective for partial coverage: Forced Path Execution Monitored Virtual Environment - run potentially malicious code in sandbox / wrapper / virtual machine, see if it does anything suspicious SOAR Partial
- Manual Static Analysis - Source Code According to SOAR [REF-1479], the following detection techniques may be useful: Highly cost effective: Manual Source Code Review (not inspections) Cost effective for partial coverage: Focused Manual Spotcheck - Focused manual analysis of source High
Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.
Mitigation and response
- Architecture and Design Libraries or Frameworks Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
- Architecture and Design Enforcement by Conversion When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs. For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-45] provide this capability.
- Architecture and Design For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
- Architecture and Design Operation Sandbox or Jail Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software. OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations. This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise. Be careful to avoid CWE-243 and other weaknesses related to jails. Limited The effectiveness of this mitigation depends on the prevention capabilities of the specific sandbox or jail being used and might only help to reduce the scope of an attack, such as restricting the attacker to certain system calls or limiting the portion of the file system that can be accessed.
Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.
Related technical context
No protocol-specific mapping is asserted for this entry.
Publisher weakness and attack-pattern relationships
These relationships retain the publisher's source attributes and view context; they do not establish that an attack or weakness applies to a particular system.
- CAPEC-175 → Related_Weakness → CWE-829 Open related reference
- CAPEC-201 → Related_Weakness → CWE-829 Open related reference
- CAPEC-228 → Related_Weakness → CWE-829 Open related reference
- CAPEC-251 → Related_Weakness → CWE-829 Open related reference
- CAPEC-252 → Related_Weakness → CWE-829 Open related reference
- CAPEC-253 → Related_Weakness → CWE-829 Open related reference
- CAPEC-263 → Related_Weakness → CWE-829 Open related reference
- CAPEC-538 → Related_Weakness → CWE-829 Open related reference
- CAPEC-549 → Related_Weakness → CWE-829 Open related reference
- CAPEC-640 → Related_Weakness → CWE-829 Open related reference
- CAPEC-660 → Related_Weakness → CWE-829 Open related reference
- CAPEC-695 → Related_Weakness → CWE-829 Open related reference
- CAPEC-698 → Related_Weakness → CWE-829 Open related reference
- CWE-827 → ChildOf → CWE-829 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-175 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-201 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-228 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-251 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-252 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-253 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-263 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-538 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-549 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-640 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-660 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-695 Open related reference
- CWE-829 → Related_Attack_Pattern → CAPEC-698 Open related reference
- CWE-829 → ChildOf → CWE-669 Open related reference
- CWE-829 → ChildOf → CWE-669 Open related reference
- CWE-830 → ChildOf → CWE-829 Open related reference
- CWE-98 → ChildOf → CWE-829 Open related reference
Authoritative sources and attribution
Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.
- https://cwe.mitre.org/data/definitions/829.html — Publisher link; not separately HTTP-checked
- MITRE CWE 5.0 source snapshot — source accessed 2026-11-26
Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.
