CVE-2026-73864: install-artifact-from-github loads downloaded native artifacts without integrity verification

High CVSS 7.5

OSV id
GHSA-88q3-gch3-5396
Also known as
CVE-2026-73864
Published
Last modified

Affected packages

PackageAffected versionsFixed in
install-artifact-from-github
npm
< 1.7.0 1.7.0

How to fix it

Upgrade install-artifact-from-github to 1.7.0 or later.

npm install install-artifact-from-github@1.7.0
# if it is an indirect dependency: npm update install-artifact-from-github (or npm audit fix)
  • If it is an indirect dependency, upgrade the package that depends on it, or force the version with "overrides" (npm), "resolutions" (Yarn) or "pnpm.overrides" (pnpm) in package.json.
  • Check the changelog for breaking changes (especially across major versions), update the lockfile with the package manager, and run your tests.

Not sure whether your project uses an affected version? Check your lockfile below for free.

Details

Description

bin/install-from-cache.js downloads a prebuilt native addon (*.node) over the network and writes it directly to the artifact path with no cryptographic integrity verification of any kind — no checksum manifest, no signature, no SRI. A scan of the whole package for createHash|sha256|checksum|integrity|digest|signature finds nothing. The file is then require()-loaded by the consumer, which executes the addon's native module-init code. Anyone able to influence the download achieves code execution on the installing machine.

Affected code (v1.6.0)
  • Mirror is fully attacker-steerable via an env var, no host pinning — bin/install-from-cache.js:80:

    let assetUrl = mirrorHost || process.env[mirrorEnvVar] || 'https://github.com';
    

    re2 passes --host-var RE2_DOWNLOAD_MIRROR, so setting RE2_DOWNLOAD_MIRROR (CI config, .npmrc/env passthrough, a compromised CI job, a poisoned shell profile) redirects 100% of the download to an arbitrary host with zero pinning.

  • The write sink is a bare writeFile, no verification — bin/install-from-cache.js:185-187:

    const write = async (name, data) => {
      await fsp.mkdir(path.dirname(name), {recursive: true});
      await fsp.writeFile(name, data);   // `data` is the raw HTTP response body
    };
    
  • Cleartext transfer + silent protocol downgrade on redirect — bin/install-from-cache.js:155,165:

    const httpLib = isHttps.test(url) ? https : isHttp.test(url) ? http : null;   // http:// supported
    ...
    get(res.headers.location).then(resolve, reject);   // re-derives protocol from the NEW url
    

    An https:// asset that 302-redirects to http:// is followed and fetched over plaintext, no warning, no scheme pinning, no redirect cap.

The post-download "verification" is not an integrity gate

isVerified() optionally runs npm run verify-build / npm test after writing the file. For re2, scripts/verify-build.js require()s the binary as its first line — i.e. the downloaded addon's native code has already executed by the time any check runs. It is a functional smoke test, not an integrity gate, and it is skipped entirely when any npm_config_platform* env var is set (:120-122).

Proof of concept

A self-contained, non-malicious PoC (poc.js) proves the missing-integrity property against the real install-from-cache, without shipping a weaponized binary: it stands up a plaintext-HTTP "mirror" serving a sentinel payload, runs install-from-cache with RE2_DOWNLOAD_MIRROR pointed at it, and shows the served bytes are written verbatim to build/Release/re2.node:

npm i install-artifact-from-github
IAFG_BIN=./node_modules/install-artifact-from-github/bin/install-from-cache.js node poc.js
attacker mirror (plaintext http) on 127.0.0.1:PORT
  [mirror] served 2083 attacker bytes over HTTP for /uhop/node-re2/releases/download/1.24.1/darwin-arm64-137
Writing to build/Release/re2.node ... Done.
install-from-cache exit: 0
served   sha256: ec6fdde6...4ebc
written  sha256: ec6fdde6...4ebc
✓ attacker bytes written VERBATIM to build/Release/re2.node — NO integrity check rejected them

The install succeeds (exit 0) with attacker-controlled bytes at the artifact path. Because a real .node executes on require() (NAPI/NODE_MODULE init), substituting a malicious one yields code execution in the installing/running process. (A full code-execution harness using a benign marker-writing native addon was verified separately and is available on request; withheld here to avoid shipping executable payloads.)

Attack scenarios (any one suffices)

  • Attacker-configured or later-compromised RE2_DOWNLOAD_MIRROR.
  • Tampered GitHub release / compromised maintainer account — no checksum detects a swapped asset, even over HTTPS.
  • On-path attacker where a plaintext (http://) mirror or an https→http redirect is in play.

Suggested fix

  1. Publish per-release SHASUMS256.txt (or embed expected digests) and verify the download's SHA-256 before writing/loading; refuse on mismatch. (This is the model prebuild-install already uses.)
  2. Reject http:// asset URLs and https→http redirect downgrades; pin scheme across redirects; cap redirect count/hosts.
  3. Document that verify-build/test run after load and cannot gate integrity.

PoC

poc.js:

```js // PoC — install-artifact-from-github writes a network-downloaded artifact to disk with NO // integrity verification, from an env-controlled mirror, over plaintext HTTP. // // This proves the CORE defect (arbitrary attacker-supplied bytes become build/Release/re2.node // with zero checksum/signature check) WITHOUT shipping a weaponized native binary: we serve a // sentinel payload and show byte-for-byte (sha256) that it is written verbatim as the artifact. // Because a .node artifact is dlopen()'d on require (running its module-init native code), an // attacker who substitutes it — via a compromi

References

Am I affected?

Upload or paste your lockfile. We check every package version in it against OSV.dev, this advisory included, and email you the vulnerable ones with the version that fixes them. Free, and no account needed.

or paste its content

Needed when you paste. package.json and pyproject.toml only have version ranges: use the lockfile next to them.

Only package names and versions are checked; the file itself is not kept. We use your email to send this report and nothing else unless you tick the box above. Privacy policy.

About this data

Source: GitHub Advisory Database via OSV.dev (CC-BY 4.0). Severity comes from the advisory's own rating when it has one, else from its CVSS score.