Vulnerability DatabaseGHSA-w62c-p8c7-w6f7

GHSA-w62c-p8c7-w6f7: 
JavaScript vulnerability analysis and mitigation

Summary

7zip-min versions 0.0.1 through 3.0.1 contain an argument-injection vulnerability in pack(). A caller-supplied source path beginning with a 7-Zip switch can be interpreted as an instruction rather than a filesystem path. An attacker who controls that argument can cause unintended files readable by the 7za process to be included in the output archive. This results in information disclosure when the application makes the archive available to the attacker.

Details

The vulnerable argument construction is present in every tagged release from 0.0.1 through 3.0.1. The implementation is in index.js in earlier releases and src/index.js in 3.0.x. pack() passes the output archive and source path directly to 7za without an end-of-options delimiter: ['a', pathToArch, pathToSrc] A source argument beginning with "-ir!" is interpreted as a recursive include switch. Because the command also contains a valid output archive path, 7za can complete the operation and include the file selected by the injected switch. In 3.0.1, unpack() and list() also pass their archive paths without the delimiter. unpackSome() protects its file selectors with "--", but leaves its archive-path argument before the delimiter. This is argument injection (CWE-88). The library uses spawn() with an argument array. The demonstrated issue does not involve shell command injection or establish remote code execution. Related hardening: During review, the bundled 7za 16.02 was also found to interpret @file arguments as local file lists even after "--". Empty source paths and empty extraction selectors can select more files than intended. The patch addresses these cases alongside the reported switch injection. The patch:

  • Places positional arguments after "--".
  • Prevents unintended @file interpretation while preserving literal filenames and supported extraction patterns.
  • Rejects empty or non-string required paths and extraction selectors before launching 7za.
  • Preserves existing support for empty optional destinations, which mean the current directory. Verification: The reported issue was reproduced on 3.0.1 with bundled 7za 16.02. All 24 release tags, from 0.0.1 through 3.0.1, were inspected and contain the vulnerable pack() argument construction. Earlier releases were verified through source inspection rather than individual runtime reproductions. All 40 tests passed locally on macOS. On November 16, 2026, the existing CI workflow was also run in a separate private repository against commit 92f4d2e37b1ab314e1859829816b9bca4ce8b443, matching the security PR. All 16 CI jobs passed, with all 40 tests passing in each job:
  • Linux, macOS, and Windows: Node.js 18, 20, 22, and 24.
  • Linux additionally: Node.js 10, 12, 14, and 16. The CI tests exercised the library through Node.js using the bundled 7za binaries, including end-to-end Windows execution through spawn(). The reporter reviewed PR #1 and independently verified the patched library on Linux with bundled 7za 16.02. Across three runs per case, the injection succeeded on unpatched 3.0.1, was blocked by the patched branch, and normal packing succeeded. The reporter also tested the vulnerable and patched argument forms using bundled Windows 7za.exe 19.00 x64, running as a Windows process. Across three runs per case, the original argument form included the canary, the patched form blocked it, and normal packing succeeded. The reporter's Windows checks exercised the executable directly rather than Node.js spawn(). End-to-end Windows verification through the library was subsequently completed by the CI matrix described above. Fixed in 7zip-min 3.0.2. Users of affected versions should upgrade to 3.0.2 or later.

Proof of concept

In an empty directory, install the affected version:

npm init -y
npm install 7zip-min@3.0.1

Save the following as poc.cjs and run node poc.cjs. The script creates only dummy files and removes its temporary directory afterward.

const fs = require('fs');
const os = require('os');
const path = require('path');
const sevenZip = require('7zip-min');
(async () => {
  const dir = fs.mkdtempSync(path.join(os.tmpdir(), '7zip-canary-'));
  try {
    const normal = path.join(dir, 'normal.txt');
    const secret = path.join(dir, 'CANARY_SECRET.txt');
    const controlArchive = path.join(dir, 'control.7z');
    const attackArchive = path.join(dir, 'attack.7z');
    fs.writeFileSync(normal, 'NORMAL FILE');
    fs.writeFileSync(secret, 'TEST SECRET - NOT REAL DATA');
    await sevenZip.pack(normal, controlArchive);
    await sevenZip.pack('-ir!' + secret, attackArchive);
    const control = await sevenZip.list(controlArchive);
    const attack = await sevenZip.list(attackArchive);
    console.log('[CONTROL]', control.map(x => x.name));
    console.log('[ATTACK]', attack.map(x => x.name));
    console.log(
      'RESULT:',
      attack.some(x => x.name.includes('CANARY_SECRET.txt'))
        ? 'VULNERABLE - CANARY INCLUDED'
        : 'NOT REPRODUCED'
    );
  } finally {
    fs.rmSync(dir, { recursive: true, force: true });
  }
})().catch(err => {
  console.error(err);
  process.exitCode = 1;
});

Observed on 7zip-min 3.0.1 with bundled 7za 16.02:

[CONTROL] [ 'normal.txt' ]
[ATTACK] [ 'CANARY_SECRET.txt' ]
RESULT: VULNERABLE - CANARY INCLUDED

The control archive contains only the normal file. The attack archive contains the dummy secret selected through the injected include switch. With the fix, the injected source is treated as a nonexistent literal path and the operation fails without including the canary.

Impact

Applications are exposed to information disclosure when they pass an attacker-controlled source argument to pack() and allow the attacker to retrieve the resulting archive. The injected include switch can select files readable by the 7za process. Actual exposure depends on application input validation, process filesystem permissions, and access to the output archive. The provisional CVSS v3.1 score is 7.5 (High): CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N This score assumes a network-accessible application permits an unauthenticated attacker to control the source argument and retrieve the archive. It does not imply that every application using 7zip-min has that exposure. The demonstrated impact is confidentiality loss. Remote code execution has not been demonstrated.


Source: NVD

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-133867CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133250CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/middie
NoYesNov 21, 2026
CVE-2026-133120CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133312MEDIUM5.3
  • JavaScript logoJavaScript
  • @fastify/rate-limit
NoYesNov 21, 2026
CVE-2026-133273LOW3.7
  • JavaScript logoJavaScript
  • @fastify/swagger-ui
NoYesNov 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management