VDB
KO
MEDIUM 5.5

GHSA-jwp9-9v96-94mx

decompress allows arbitrary hardlink creation during archive extraction

Details

decompress before 4.2.2 allows arbitrary hardlink creation during archive extraction, enabling file read disclosure and file corruption. When processing hardlink entries (type === 'link'), the x.linkname field from the archive is passed directly to fs.link() without validation (index.js line 113). An attacker can craft an archive with a hardlink entry whose linkname is an absolute path to any file on the same filesystem. This creates a hardlink inside the extraction directory that shares the same inode as the target file, enabling both reading and overwriting the original file's content. Hardlinks are limited to files on the same filesystem and cannot target directories.

Are you affected?

Enter the version of the package you're using.

Affected packages

npm / decompress
Introduced in: 0

No fixed version published yet for decompress (npm). Pin to a known-safe version or switch to an alternative.

References