---
title: "CWE-494: Download of Code Without Integrity Check"
url: https://radicalnotion.ai/cwe/cwe-494
type: cwe
description: "The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code."
updated: 2026-11-10
source: RadicalNotion.AI
license: CC BY-NC 4.0 (https://creativecommons.org/licenses/by-nc/4.0/)
---

# CWE-494: Download of Code Without Integrity Check

- **Abstraction:** Base
- **Structure:** Simple
- **Status:** Draft
- **Likelihood of exploit:** Medium
- **CVEs with this as primary weakness:** 246
- **Of those, in CISA KEV:** 4
- **New in 2026:** 78
- **CWE catalog version:** 4.21

## Description

The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.

## Modes of introduction

| Phase | Note |
| --- | --- |
| Architecture and Design | OMISSION: This weakness is caused by missing a security tactic during the architecture and design phase. |
| Implementation | - |

## Common consequences

| Scope | Impact | Note |
| --- | --- | --- |
| Integrity, Availability, Confidentiality, Other | Execute Unauthorized Code or Commands, Alter Execution Logic, Other | An attacker can execute malicious code by compromising the host server, performing DNS spoofing, or modifying the code in transit. Executing untrusted code could compromise the control flow of the program. The untrusted code could execute attacker-controlled commands, read or modify sensitive resources, or prevent the software from functioning correctly for legitimate users. |

## Potential mitigations

### Implementation

Perform proper forward and reverse DNS lookups to detect DNS spoofing.

### Architecture and Design, Operation

Encrypt the code with a reliable encryption scheme before transmitting.

### 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\].

Speficially, it may be helpful to use tools or frameworks to perform integrity checking on the transmitted code.

- When providing the code that is to be downloaded, such as for automatic updates of the software, then use cryptographic signatures for the code and modify the download clients to verify the signatures. Ensure that the implementation does not contain CWE-295, CWE-320, CWE-347, and related weaknesses.
- Use code signing technologies such as Authenticode. See references \[REF-454\] \[REF-455\] \[REF-456\].

### Architecture and Design, Operation (Environment Hardening)

Run your code using the lowest privileges that are required to accomplish the necessary tasks \[REF-76\]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.

### 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.

Effectiveness: 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.

## Detection methods

### Manual Analysis

This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.

Specifically, manual static analysis is typically required to find the behavior that triggers the download of code, and to determine whether integrity-checking methods are in use.

### Black Box

Use monitoring tools that examine the software's process as it interacts with the operating system and the network. This technique is useful in cases when source code is unavailable, if the software was not developed by you, or if you want to verify that the build phase did not introduce any new weaknesses. Examples include debuggers that directly attach to the running process; system-call tracing utilities such as truss (Solaris) and strace (Linux); system activity monitors such as FileMon, RegMon, Process Monitor, and other Sysinternals utilities (Windows); and sniffers and protocol analyzers that monitor network traffic.

Attach the monitor to the process and also sniff the network connection. Trigger features related to product updates or plugin installation, which is likely to force a code download. Monitor when files are downloaded and separately executed, or if they are otherwise read back into the process. Look for evidence of cryptographic library calls that use integrity checking.

### Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Effectiveness: High

## Demonstrative examples

### Example 1

This example loads an external class from a local subdirectory.

Bad code:

```java
URL[] classURLs= new URL[]{
    new URL("file:subdir/")
};
URLClassLoader loader = new URLClassLoader(classURLs);
Class loadedClass = Class.forName("loadMe", true, loader);
```

This code does not ensure that the class loaded is the intended one, for example by verifying the class's checksum. An attacker may be able to modify the class file to execute malicious code.

### Example 2

This code includes an external script to get database credentials, then authenticates a user against the database, allowing access to the application.

Bad code:

```php
//assume the password is already encrypted, avoiding CWE-312

function authenticate($username,$password){

    include("http://external.example.com/dbInfo.php");

    //dbInfo.php makes $dbhost, $dbuser, $dbpass, $dbname available
    mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
    mysql_select_db($dbname);
    $query = 'Select * from users where username='.$username.' And password='.$password;
    $result = mysql_query($query);

    if(mysql_numrows($result) == 1){
        mysql_close();
        return true;
    }
    else{
        mysql_close();
        return false;
    }

}
```

## Observed examples

| CVE | Description |
| --- | --- |
| CVE-2019-9534 | Satellite phone does not validate its firmware image. |
| CVE-2021-22909 | Chain: router's firmware update procedure uses curl with "-k" (insecure) option that disables certificate validation (CWE-295), allowing adversary-in-the-middle (AITM) compromise with a malicious firmware image (CWE-494). |
| CVE-2008-3438 | OS does not verify authenticity of its own updates. |
| CVE-2008-3324 | online poker client does not verify authenticity of its own updates. |
| CVE-2001-1125 | anti-virus product does not verify automatic updates for itself. |
| CVE-2002-0671 | VOIP phone downloads applications from web sites without verifying integrity. |

## Real CVEs with this weakness (sample of 12 of 246)

| CVE | Title | Severity | CVSS | EPSS | CISA KEV | Published |
| --- | --- | --- | --- | --- | --- | --- |
| CVE-2026-3502 | TrueConf Client Update Integrity Verification Bypass | high | 8.8 | - | Yes | 2026-03-30 |
| CVE-2022-40799 | D-Link DNR-322L Download of Code Without Integrity Check Vulnerability | high | 8.7 | - | Yes | 2022-11-29 |
| CVE-2025-15556 | Notepad++ \< 8.8.9 WinGUp Updater Lacks Update Integrity Verification | high | 7.7 | - | Yes | 2026-02-03 |
| CVE-2021-44168 | Fortinet FortiOS Arbitrary File Download | medium | 4.8 | - | Yes | 2022-01-04 |
| CVE-2026-22306 | Critical flaw impacting OZOLS ERP's automatic update channel | critical | 10.0 | - | No | 2026-08-19 |
| CVE-2020-1595 | Microsoft SharePoint Remote Code Execution Vulnerability | critical | 9.9 | - | No | 2020-09-11 |
| CVE-2020-1210 | Microsoft SharePoint Remote Code Execution Vulnerability | critical | 9.9 | - | No | 2020-09-11 |
| CVE-2026-73595 | - | critical | 9.8 | - | No | 2026-09-29 |
| CVE-2026-30612 | - | critical | 9.8 | - | No | 2026-08-27 |
| CVE-2026-65081 | - | critical | 9.8 | - | No | 2026-08-25 |
| CVE-2026-34841 | Axios npm Supply Chain Incident Impacting @usebruno/cli | critical | 9.8 | - | No | 2026-04-06 |
| CVE-2025-40604 | - | critical | 9.8 | - | No | 2025-11-20 |

## Related attack patterns (CAPEC)

- [CAPEC-184](https://radicalnotion.ai/capec/capec-184): Software Integrity Attack
- [CAPEC-185](https://radicalnotion.ai/capec/capec-185): Malicious Software Download
- [CAPEC-186](https://radicalnotion.ai/capec/capec-186): Malicious Software Update
- [CAPEC-187](https://radicalnotion.ai/capec/capec-187): Malicious Automated Software Update via Redirection
- [CAPEC-533](https://radicalnotion.ai/capec/capec-533): Malicious Manual Software Update
- [CAPEC-538](https://radicalnotion.ai/capec/capec-538): Open-Source Library Manipulation
- [CAPEC-657](https://radicalnotion.ai/capec/capec-657): Malicious Automated Software Update via Spoofing
- [CAPEC-662](https://radicalnotion.ai/capec/capec-662): Adversary in the Browser (AiTB)
- [CAPEC-691](https://radicalnotion.ai/capec/capec-691): Spoof Open-Source Software Metadata
- [CAPEC-692](https://radicalnotion.ai/capec/capec-692): Spoof Version Control System Commit Metadata
- [CAPEC-693](https://radicalnotion.ai/capec/capec-693): StarJacking
- [CAPEC-695](https://radicalnotion.ai/capec/capec-695): Repo Jacking

## Related weaknesses

| Relationship | CWE | Name |
| --- | --- | --- |
| Parent | [CWE-345](https://radicalnotion.ai/cwe/cwe-345) | Insufficient Verification of Data Authenticity |
| Parent | [CWE-669](https://radicalnotion.ai/cwe/cwe-669) | Incorrect Resource Transfer Between Spheres |
| Related | [CWE-79](https://radicalnotion.ai/cwe/cwe-79) | Improper Neutralization of Input During Web Page Generation |

## Taxonomy mappings

| Taxonomy | Entry | Id | Fit |
| --- | --- | --- | --- |
| CLASP | Invoking untrusted mobile code | - | - |
| The CERT Oracle Secure Coding Standard for Java (2011) | Do not rely on the default automatic signature verification provided by URLClassLoader and java.util.jar | SEC06-J | - |
| Software Fault Patterns | Tainted input to environment | SFP27 | - |

## Frequently asked questions

### What is CWE-494?

The product downloads source code or an executable from a remote location and executes the code without sufficiently verifying the origin and integrity of the code.

### What CVEs are caused by CWE-494?

246 recorded CVEs are attributed to CWE-494, including CVE-2026-3502, CVE-2022-40799 and CVE-2025-15556. 4 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.

### How do you prevent CWE-494?

Perform proper forward and reverse DNS lookups to detect DNS spoofing.

### How is CWE-494 detected?

Manual Analysis: This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session.

### What are the consequences of CWE-494?

Exploiting CWE-494 can lead to: Execute Unauthorized Code or Commands, Alter Execution Logic, Other.

### Is CWE-494 actively exploited?

Yes. 4 CWE-494 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 246 recorded CVEs.

Primary source: [MITRE CWE](https://cwe.mitre.org/data/definitions/494.html)

---

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