Definition

MITRE’s description of 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.

Common consequences MITRE lists

  • Integrity, Availability, Confidentiality, Other: Execute Unauthorized Code or Commands; Alter Execution Logic; Other

Why it matters

Whoever can tamper with the download path, whether a mirror, a CDN or the update server, gets code execution on every installation.

How to prevent it

  • Verify signatures or pinned digests on every downloaded artifact before installing or running it.
  • Protect update metadata against rollback and freeze attacks, for example with The Update Framework (TUF).
  • Keep signing keys separate from the distribution infrastructure.

Guides on this site

Main subject · Guide

Protect package publication and the update channel

Constrain release identities, verify what consumers receive, and prepare for publisher or update-key compromise.

Main subject · Guide

Design firmware updates that can recover safely

Connect trusted boot, update authorization, rollback policy and end-of-life behavior to the device’s actual failure modes.

Also covers this · Guide

Verify artifact signatures against an explicit trust policy

Require the expected artifact, signer and release context before allowing a signed package or image to proceed.

Also covers this · Guide

Stop dependency confusion and typosquatting at install time

Pin every internal package name to its real source, verify installed bytes against a lockfile, and delay or gate install scripts so a public look-alike cannot replace a private dependency.

Also covers this · Case study

Case study: the xz Utils backdoor (CVE-2024-3094)

How a multi-year maintainer takeover planted a backdoor in xz Utils release tarballs, how build-time injection hid it from the git repository, why a performance anomaly exposed it, which systems shipped it, and what it teaches about reproducible builds and maintainer health.

Also covers this · Case study

Case study: the tj-actions/changed-files compromise (CVE-2025-30066)

In March 2025 an attacker moved the version tags of a popular GitHub Action, and of a reviewdog action before it, to code that printed CI secrets into build logs. This case study traces the token chain back to one pull_request_target workflow, sizes the exposure, and shows how it was caught and which controls held.

Also covers this · Guide

Harden container images from Dockerfile to admission

Build minimal, non-root images pinned by digest, keep secrets out of every layer, then scan, sign and verify the exact digest before it runs with dropped privileges.

Also covers this · Guide

Place each security control in the pipeline and decide what it blocks

Put secrets scanning, SAST, SCA, IaC and image scanning, DAST, fuzzing, attestation and admission control where each sees the right input, block only on findings a developer can act on, and deploy only images the pipeline has attested.

Cites this weakness · Guide

Read SLSA provenance and verify the claim you need

Connect an artifact to its build evidence while distinguishing provenance, build assurance and source controls.

Cites this weakness · Guide

Treat model releases as executable supply-chain inputs

Verify provenance, constrain loading and preserve the relationship between model weights, configuration and runtime dependencies.

Cites this weakness · Case study

Case study: the Codecov Bash Uploader compromise (2021)

How a credential leaked through Codecov's Docker image process let an attacker change the Bash Uploader that many CI pipelines downloaded and ran, which sent their environment variables, and the secrets in them, to the attacker for two months in 2021.

Cites this weakness · Case study

Case study: the polyfill.io CDN takeover (2024)

How the sale of the polyfill.io domain and project in February 2024 turned a script tag on more than 100,000 websites into a channel for malicious redirects by June, why Subresource Integrity could not have protected it, and the controls that would have.

Cites this weakness · Guide

Map PCI DSS Requirement 6 to engineering practice and evidence

Turn PCI DSS v4.0.1 Requirement 6 into engineering work: secure development, review, patching, web-attack protection, payment-page script control and change management, with the records an assessor samples and the parts that became mandatory on 31 March 2025.

Practice

References

  1. CWE-494 in the MITRE CWE list (version 4.20)

List data from MITRE; the name, definition and consequences are from MITRE’s CWE 4.20 catalogue. A guide is listed as the main subject when the weakness is what the guide is about, and as covering it when a dedicated section or worked example addresses it.

CWE content: Copyright © 2006–2026, The MITRE Corporation. CWE, CWSS, CWRAF, and the CWE logo are trademarks of The MITRE Corporation. CWE™ is free to use by any organization or individual for any research, development, and/or commercial purposes, per these CWE Terms of Use. Accordingly, The MITRE Corporation hereby grants you a non-exclusive, royalty-free license to use CWE for research, development, and commercial purposes. Any copy you make for such purposes is authorized on the condition that you reproduce MITRE’s copyright designation and this license in any such copy. CWE is a trademark of The MITRE Corporation. CWE Terms of Use.