Skip to content
OpenAdvisories

Weakness (CWE)

CWE-494: Download of Code Without Integrity Check

Base Draft

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.

How to prevent it (5 mitigations)
  1. Implementation

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

  2. Architecture and Design, Operation

    Encrypt the code with a reliable encryption scheme before transmitting.

  3. Architecture and Design

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

  4. Architecture and Design, Operation

    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.

  5. Architecture and Design, Operation

    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.

Source: MITRE CWE-494

47 results · Clear filters · Feed

  • Medium 6.4

    Improper Input Validation in Bitdefender Endpoint Security Tools for Linux

    An Improper Input Validation vulnerability in the Product Update feature of Bitdefender Endpoint Security Tools for Linux allows a man-in-the-middle attacker to abuse the DownloadFile function of the Product Update to achieve remote code execution. This issue…

  • Medium 5.5

    MyBrowserPlus downloads the files needed to run the program through the setup file (Setup.inf). At this time, there is …

  • Medium 5.7

    A vulnerability was found in OpenShift builds, versions 4.1 up to 4.3. Builds that extract source from a container imag…

  • Medium 4.6

    Cargo prior to Rust 1.26.0 may download the wrong dependency

    Cargo prior to Rust 1.26.0 may download the wrong dependency if your package.toml file uses the `package` configuration key. Usage of the `package` key to rename dependencies in `Cargo.toml` is ignored in Rust 1.25.0 and prior. When Rust 1.25.0 and prior is u…

  • Medium 4.7

    The OpenStack RabbitMQ container image insecurely retrieves the rabbitmq_clusterer component over HTTP during the build…

  • Medium 5.3

    Akeo Consulting Rufus prior to version 2.17.1187 does not adequately validate the integrity of updates downloaded over …

  • Medium 6.5

    Sensys Networks Traffic Sensor Download of Code Without Integrity Check

    Sensys Networks VSN240-F and VSN240-T sensors VDS before 2.10.1 and TrafficDOT before 2.10.3 do not verify the integrity of downloaded updates, which allows remote attackers to execute arbitrary code via a Trojan horse update.