Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

tar

Latest version: v8.0.4

Overview

Last scanned
30 Nov 2026
Published
30 Nov 2026
npm package Publisher: isaacs
931 Stars
294 Forks
6 Versions
489.2M Downloads
TypeScript Repo language

Scan summary

tar was last scanned on 30 Nov 2026 at version 8.0.4. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 6 versions; the latest 5 were published within 3 days (28–30 Nov 2026).
  • Findings: No rules fired in version 8.0.4.
  • Downloads: 489,201,715 downloads.

Versions

6 versions published
Versions and the rules that fired in each
VersionPublishedStatus
8.0.4 LATEST 30 Nov 2026 No rules fired
8.0.3 30 Nov 2026 No rules fired
8.0.2 28 Nov 2026 No rules fired
8.0.1 28 Nov 2026 Not shown
8.0.0 28 Nov 2026 Not shown

No rules fired in 8.0.4

Findings

Findings for v8.0.4. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 8.0.4; other versions have their own rules, not their own score.

Known vulnerabilities

21 CVEs · last 13 Aug 2026

1 CRITICAL 15 HIGH 5 MEDIUM 0 LOW

Versions

  • ≥ 7.5.21
  • ≥ 7.5.19, < 7.5.21 1 HIGH
  • ≥ 7.5.18, < 7.5.19 1 CRITICAL 1 HIGH
  • ≥ 7.5.17, < 7.5.18 1 CRITICAL 3 HIGH
  • ≥ 7.5.16, < 7.5.17 1 CRITICAL 3 HIGH 1 MEDIUM
  • ≥ 7.5.11, < 7.5.16 1 CRITICAL 3 HIGH 2 MEDIUM
  • ≥ 7.5.10, < 7.5.11 1 CRITICAL 4 HIGH 2 MEDIUM
  • ≥ 7.5.8, < 7.5.10 1 CRITICAL 5 HIGH 2 MEDIUM
  • ≥ 7.5.7, < 7.5.8 1 CRITICAL 6 HIGH 2 MEDIUM
  • ≥ 7.5.4, < 7.5.7 1 CRITICAL 7 HIGH 2 MEDIUM
Show all 36 version ranges
  • ≥ 7.5.3, < 7.5.4 1 CRITICAL 7 HIGH 3 MEDIUM
  • ≥ 7.5.2, < 7.5.3 1 CRITICAL 8 HIGH 3 MEDIUM
  • ≥ 7.5.1, < 7.5.2 1 CRITICAL 8 HIGH 4 MEDIUM
  • ≥ 6.2.1, < 7.5.1 1 CRITICAL 8 HIGH 3 MEDIUM
  • ≥ 6.1.9, < 6.2.1 1 CRITICAL 8 HIGH 4 MEDIUM
  • ≥ 6.1.7, < 6.1.9 1 CRITICAL 10 HIGH 4 MEDIUM
  • ≥ 6.1.2, < 6.1.7 1 CRITICAL 11 HIGH 4 MEDIUM
  • ≥ 6.1.1, < 6.1.2 1 CRITICAL 12 HIGH 4 MEDIUM
  • ≥ 6.0.0, < 6.1.1 1 CRITICAL 13 HIGH 4 MEDIUM
  • ≥ 5.0.10, < 6.0.0 1 CRITICAL 8 HIGH 4 MEDIUM
  • ≥ 5.0.8, < 5.0.10 1 CRITICAL 10 HIGH 4 MEDIUM
  • ≥ 5.0.7, < 5.0.8 1 CRITICAL 11 HIGH 4 MEDIUM
  • ≥ 5.0.6, < 5.0.7 1 CRITICAL 12 HIGH 4 MEDIUM
  • ≥ 5.0.0, < 5.0.6 1 CRITICAL 13 HIGH 4 MEDIUM
  • ≥ 4.4.18, < 5.0.0 1 CRITICAL 8 HIGH 4 MEDIUM
  • ≥ 4.4.16, < 4.4.18 1 CRITICAL 10 HIGH 4 MEDIUM
  • ≥ 4.4.15, < 4.4.16 1 CRITICAL 11 HIGH 4 MEDIUM
  • ≥ 4.4.14, < 4.4.15 1 CRITICAL 12 HIGH 4 MEDIUM
  • ≥ 4.4.2, < 4.4.14 1 CRITICAL 13 HIGH 4 MEDIUM
  • ≥ 4.0.0, < 4.4.2 1 CRITICAL 14 HIGH 4 MEDIUM
  • ≥ 3.2.3, < 4.0.0 1 CRITICAL 12 HIGH 4 MEDIUM
  • ≥ 3.2.2, < 3.2.3 1 CRITICAL 13 HIGH 4 MEDIUM
  • ≥ 3.0.0, < 3.2.2 1 CRITICAL 14 HIGH 4 MEDIUM
  • ≥ 2.2.2, < 3.0.0 1 CRITICAL 10 HIGH 4 MEDIUM
  • ≥ 2.0.0, < 2.2.2 1 CRITICAL 11 HIGH 4 MEDIUM
  • < 2.0.0 1 CRITICAL 12 HIGH 4 MEDIUM

Vulnerabilities

  • CVE-2026-73566 High 13 Aug 2026 tar: node-tar: Denial of Service via crafted long-path tar archive Fixed in 7.5.21
  • CVE-2026-59875 Medium 8 Jul 2026 node-tar: node-tar: Denial of Service via crafted archive with NUL bytes in metadata Fixed in 7.5.17
  • CVE-2026-59874 High 8 Jul 2026 tar: Node-tar: Denial of Service via malformed tar archive header Fixed in 7.5.18
  • CVE-2026-59873 Critical 8 Jul 2026 tar: node-tar: Denial of Service via crafted gzip bomb Fixed in 7.5.19
  • CVE-2026-59871 High 8 Jul 2026 node-tar: node-tar: Denial of Service due to incorrect PAX path handling Fixed in 7.5.18
  • CVE-2026-53655 Medium 22 Jun 2026 node-tar: node-tar: File smuggling due to inconsistent tar archive parsing Fixed in 7.5.16
  • CVE-2026-31802 High 10 Mar 2026 tar: tar: File overwrite via drive-relative symlink traversal Fixed in 7.5.11
  • CVE-2026-29786 High 7 Mar 2026 node-tar: hardlink path traversal via drive-relative linkpath Fixed in 7.5.10
  • CVE-2026-26960 High 20 Feb 2026 node-tar: node-tar: Arbitrary file read/write via malicious archive hardlink creation Fixed in 7.5.8
  • CVE-2026-24842 High 28 Jan 2026 node-tar: tar: node-tar: Arbitrary file creation via path traversal bypass in hardlink security check Fixed in 7.5.7
  • CVE-2026-23950 Medium 20 Jan 2026 node-tar: tar: node-tar: Arbitrary file overwrite via Unicode path collision race condition Fixed in 7.5.4
  • CVE-2026-23745 High 16 Jan 2026 node-tar: tar: node-tar: Arbitrary file overwrite and symlink poisoning via unsanitized linkpaths in archives Fixed in 7.5.3
  • CVE-2025-64118 Medium 30 Oct 2025 node-tar: tar: node-tar: Information disclosure via reading a truncated tar file Fixed in 7.5.2
  • CVE-2024-28863 Medium 21 Mar 2024 node-tar: denial of service while parsing a tar file due to lack of folders depth validation Fixed in 6.2.1
  • CVE-2021-37713 High 31 Aug 2021 nodejs-tar: Arbitrary File Creation/Overwrite on Windows via insufficient relative path sanitization Fixed in 4.4.18, 5.0.10, 6.1.9
  • CVE-2021-37712 High 31 Aug 2021 nodejs-tar: Insufficient symlink protection due to directory cache poisoning using symbolic links allowing arbitrary file creation and overwrite Fixed in 4.4.18, 5.0.10, 6.1.9
  • CVE-2021-37701 High 31 Aug 2021 nodejs-tar: Insufficient symlink protection due to directory cache poisoning using symbolic links allowing arbitrary file creation and overwrite Fixed in 4.4.16, 5.0.8, 6.1.7
  • CVE-2021-32804 High 3 Aug 2021 nodejs-tar: Insufficient absolute path sanitization allowing arbitrary file creation and overwrite Fixed in 3.2.2, 4.4.14, 5.0.6, 6.1.1
  • CVE-2021-32803 High 3 Aug 2021 nodejs-tar: Insufficient symlink protection allowing arbitrary file creation and overwrite Fixed in 3.2.3, 4.4.15, 5.0.7, 6.1.2
  • CVE-2018-20834 High 30 Apr 2019 nodejs-tar: Arbitrary file overwrites when extracting tarballs containing a hard-link Fixed in 4.4.2, 2.2.2
  • CVE-2015-8860 High 23 Jan 2017 nodejs-tar: insecure processing of symbolic links during package processing Fixed in 2.0.0

Seal Security (npm)

Seal Security ships a patched build of this package. Its fixed versions:

  • CVE-2024-28863: 2.2.1-sp2, 4.4.13-sp2
  • CVE-2026-23745: 2.2.1-sp2, 4.4.13-sp2, 6.0.5-sp2
  • CVE-2026-24842: 2.2.1-sp2, 4.4.13-sp3, 6.0.5-sp2
  • CVE-2026-26960: 2.2.1-sp2, 4.4.13-sp4, 6.0.5-sp2
  • CVE-2026-29786: 2.2.1-sp2, 4.4.13-sp4, 6.0.5-sp3
  • CVE-2026-31802: 2.2.1-sp2, 4.4.13-sp4, 6.0.5-sp3
  • CVE-2026-53655: 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2
  • CVE-2026-59871: 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2
  • CVE-2026-59873: 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2
  • CVE-2026-59874: 2.2.1-sp3, 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2
  • CVE-2026-59875: 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2
  • CVE-2026-73566: 4.4.13-sp5, 4.4.19-sp999, 6.0.5-sp3, 6.2.1-sp2, 7.5.16-sp999, 7.5.7-sp999, 7.5.8-sp999, 7.5.9-sp2

README

The publisher’s own README, as collected from the registry.

tar

Tar for JavaScript.

This package reads and writes tar archives. It makes archives from files or from data in memory. It extracts archives to a file system, or gives you the entries one at a time. It reads and writes gzip, and in a server-side runtime also brotli and zstd.

The package has two entry points:

  • tar is for server-side runtimes: Node.js, and each other runtime that has the node: modules, such as Bun, Deno, and Cloudflare. It uses node:fs and node:zlib, and it has sync commands. Most users want this entry point.
  • tar/core is for browsers and each other runtime. It uses no node: module. It runs in a browser, in a worker, and in each runtime that has web streams. It needs the fs option for work on files.

The package has no runtime dependencies. The API uses promises, web streams, and Uint8Array.

Install

npm install tar

tar needs Node.js 22 or later, or another server-side runtime that has the node: modules. tar/core also runs in a browser.

The package has ES module and CommonJS builds. You can use import or require().

Quick start

These examples use tar, the server-side entry point. A command has two arguments: an options object, and for most commands a list of files.

Create an archive
import { create } from 'tar'

// A gzip archive of a directory and a file.
await create({ file: 'demo.tgz', gzip: true }, ['src', 'package.json'])

With no file option, create() returns a ReadableStream of the bytes of the archive.

import { createWriteStream } from 'node:fs'
import { Writable } from 'node:stream'
import { create } from 'tar'

const stream = create({ gzip: true }, ['src', 'package.json'])
await stream.pipeTo(Writable.toWeb(createWriteStream('demo.tgz')))
Extract an archive

The directory to extract into must exist. The default is the current working directory.

import { mkdir } from 'node:fs/promises'
import { extract } from 'tar'

await mkdir('out', { recursive: true })
await extract({ file: 'archive.tgz', cwd: 'out' })

// Only some entries, with the first part of each path removed.
await extract({ file: 'archive.tgz', cwd: 'out', strip: 1 }, ['src/lib'])

The input option gives the archive as data. It can be a Uint8Array, an ArrayBuffer, a Blob, a ReadableStream, or an iterable of Uint8Array chunks.

import { mkdir } from 'node:fs/promises'
import { extract } from 'tar'

const res = await fetch('https://example.com/archive.tgz')
await mkdir('out', { recursive: true })
await extract({ input: res.body, cwd: 'out' })
List the entries
import { list } from 'tar'

await list({
  file: 'archive.tgz',
  onEntry: entry => console.log(entry.type, entry.path, entry.size),
})

To read the content of the entries, use entries(). It is an async iterator.

import { readFile } from 'node:fs/promises'
import { entries } from 'tar'

for await (const entry of entries(await readFile('archive.tgz'))) {
  if (entry.path === 'package.json') {
    console.log(JSON.parse(await entry.text()))
  }
}
Add files to an archive

replace() adds entries to the end of an archive that is not compressed. update() does the same, but it adds a file only if it is newer than the entry of the same path in the archive.

import { replace, update } from 'tar'

await replace({ file: 'archive.tar' }, ['notes.txt'])
await update({ file: 'archive.tar' }, ['src', 'package.json'])
Sync commands

Each command of tar has a sync form. A sync command returns when the work is done. tar/core has no sync commands.

import { mkdirSync } from 'node:fs'
import {
  createSync,
  extractSync,
  listSync,
  deleteSync,
  replaceSync,
  updateSync,
} from 'tar'

createSync({ file: 'demo.tar' }, ['src'])
replaceSync({ file: 'demo.tar' }, ['package.json'])
updateSync({ file: 'demo.tar' }, ['README.md'])
deleteSync({ file: 'demo.tar' }, ['package.json'])
listSync({
  file: 'demo.tar',
  onEntry: entry => console.log(entry.path),
})
mkdirSync('out', { recursive: true })
extractSync({ file: 'demo.tar', cwd: 'out' })

With no file option, createSync() returns an iterator of Uint8Array chunks.

Entry points

Import Use
tar Server-side runtimes: Node.js, and each other runtime that has the node: modules (Bun, Deno, Cloudflare). All of the core, the defaults below, the sync commands, and the node:zlib codecs.
tar/core Browsers, and each other runtime. The core: no node: module, no process, no Buffer. The async commands and the classes. It needs the fs option for work on files.
tar/raw, tar/core/raw The same two entry points as separate modules that are not minified.

tar and tar/core are each one minified file.

The defaults of tar

Each command of tar calls the command of the core with these defaults:

Option Default in tar
fs node:fs/promises. node:fs for a sync command.
cwd process.cwd(). A relative cwd is resolved from it.
platform 'win32' if process.platform is 'win32'. If not, 'posix'.
processUid process.getuid()
processGid process.getgid()
processUname process.env.USER
processUmask process.umask(), only when chmod is set
codecs Your codecs, then gzip, brotli, and zstd from node:zlib

list() and entries() write no file. They get only the fs, platform, and codecs defaults.

The core in a browser or another runtime

tar/core is the core. It does not know the file system, the working directory, the platform, or the user of the process. You give them as options.

The core needs these globals: ReadableStream, TransformStream, Blob, TextEncoder, TextDecoder, and crypto.getRandomValues. It needs CompressionStream and DecompressionStream for gzip.

A command of the core works with no fs option, if it does not touch a file:

  • entries(input) and list({ input }) read archive data.
  • create() with no file option, and with entries from memory, returns a stream.

This example reads an archive from a fetch() response. It stops the download when it has the entry.

import { entries } from 'tar/core'

const res = await fetch('https://example.com/archive.tgz')
for await (const entry of entries(res.body)) {
  if (entry.path === 'package.json') {
    console.log(JSON.parse(await entry.text()))
    break
  }
}

This example makes a gzip archive in memory, and reads it from a Blob. A File from a file input is also a Blob.

import { create, entries, WriteEntry } from 'tar/core'

const stream = create({ gzip: true }, [
  new WriteEntry({ path: 'hello.txt' }, 'hello\n'),
  new WriteEntry({ path: 'data.bin' }, new Uint8Array([1, 2, 3])),
])
const blob = await new Response(stream).blob()

for await (const entry of entries(blob)) {
  console.log(entry.path, entry.size)
}
The input option

list() and extract() read the archive from input, or from the path file through fs. entries() takes the input as its first argument. The input can be:

  • a Uint8Array or an ArrayBuffer
  • a Blob
  • a ReadableStream<Uint8Array>
  • an async iterable or an iterable of Uint8Array chunks

A sync command takes a Uint8Array, an ArrayBuffer, or an iterable of Uint8Array chunks.

The readers do not copy the input. Do not change a chunk after you give it.

When input is set, file is only the name of the archive. Warnings have it, and the readers use it to find a format by the file name.

The fs option

The fs option is an object with file system functions. Each function has the signature of the function of the same name in node:fs/promises. For a sync command, it is the function of node:fs. A command calls only the functions in its type.

Type Commands Functions
TarFS list() and extract() with file, and an @archive operand open(path, 'r'). The handle has read, stat, and close.
ExtractFS extract() open, stat, lstat, mkdir, chmod, chown, lchown, utimes, lutimes, rmdir, unlink, rename, link, symlink. The handle has write, utimes, chown, and close. constants is optional.
CreateFS create() open, lstat, stat, readdir, readlink. The handle has read, write, stat, and close. lstat and stat can get the option { bigint: true }.
ReplaceFS replace(), update() The same as CreateFS. open gets the flags 'r+', 'w+', and 'r'.
DeleteFS delete() TarFS and CreateFS, and rename and unlink.

The sync types are TarFSSync, ExtractFSSync, CreateFSSync, ReplaceFSSync, and DeleteFSSync. They have the functions of node:fs that work on a file descriptor: openSync, fstatSync, readSync, writeSync, futimesSync, fchownSync, closeSync, and the sync forms of the path functions above.

Notes for an ExtractFS:

  • mkdir must fail if the path exists. lstat and stat must fail if the path does not exist.
  • If fs.constants has O_CREAT, O_TRUNC, O_WRONLY, and O_NOFOLLOW, then open gets a number as its flag. With O_NOFOLLOW, open does not follow a symbolic link at the path. Without constants, the flag is 'w'.
  • chown and lchown are called only when the options set an owner. chmod is called only with the chmod option. rename is called only with platform: 'win32'.

Notes for a CreateFS:

  • create() knows a file by the dev and ino numbers of its stat. Node.js gives the two values as numbers. On Windows, most ino values are too large for a number, and then two files can have the same number.
  • A wrong match loses data in two cases: a file with more than one link is written as a hard link to a different file, and with follow, a directory is skipped as a directory in itself. Only in these cases, and only when dev or ino is not a safe integer, create() calls lstat (stat with follow) one more time with the option { bigint: true }, and reads the dev and ino of the result. node:fs gives exact bigint values with this option.
  • A file with one link, and a directory without follow, never get that call. The check that a path is the same object after open and after readdir compares the numbers.
  • Your function can ignore the option and return the stat with numbers. create() then uses the numbers. Two files with the same dev and ino numbers, and more than one link, are then one file and a hard link to it.

This example extracts an archive into a Map.

import { create, extract, WriteEntry } from 'tar/core'

// path -> { type, mode, mtime, chunks, target }
const tree = new Map([
  ['/out', { type: 'dir', mode: 0o755, mtime: new Date() }],
])
const fail = (code, path) =>
  Object.assign(new Error(`${code}: ${path}`), { code })
const get = path => {
  const node = tree.get(path)
  if (!node) throw fail('ENOENT', path)
  return node
}
const stats = node => ({
  isDirectory: () => node.type === 'dir',
  isFile: () => node.type === 'file',
  isSymbolicLink: () => node.type === 'symlink',
  nlink: 1,
  mode: node.mode,
  mtime: node.mtime,
})
const setTime = async (path, atime, mtime) => {
  get(path).mtime = mtime
}

const memfs = {
  stat: async path => stats(get(path)),
  lstat: async path => stats(get(path)),
  mkdir: async (path, { mode }) => {
    if (tree.has(path)) throw fail('EEXIST', path)
    tree.set(path, { type: 'dir', mode, mtime: new Date() })
    return undefined
  },
  open: async (path, flags, mode) => {
    const file = { type: 'file', mode, mtime: new Date(), chunks: [] }
    tree.set(path, file)
    return {
      // `data` is a view into the archive data. Keep a copy.
      write: async data => file.chunks.push(data.slice()),
      utimes: async (atime, mtime) => {
        file.mtime = mtime
      },
      chown: async () => {},
      close: async () => {},
    }
  },
  symlink: async (target, path) => {
    tree.set(path, { type: 'symlink', mode: 0o777, target })
  },
  link: async (target, path) => {
    tree.set(path, get(target))
  },
  unlink: async path => {
    tree.delete(path)
  },
  rmdir: async path => {
    tree.delete(path)
  },
  rename: async (from, to) => {
    tree.set(to, get(from))
    tree.delete(from)
  },
  chmod: async (path, mode) => {
    get(path).mode = mode
  },
  chown: async () => {},
  lchown: async () => {},
  utimes: setTime,
  lutimes: setTime,
}

const archive = create({}, [
  new WriteEntry({ path: 'docs/', type: 'Directory', mode: 0o755 }),
  new WriteEntry({ path: 'docs/hello.txt', mode: 0o644 }, 'hello\n'),
  new WriteEntry({ path: 'docs/deep/more.txt' }, 'more\n'),
])

await extract({ input: archive, fs: memfs, cwd: '/out' })

for (const [path, node] of tree) console.log(node.type, path)
console.log(await new Blob(tree.get('/out/docs/hello.txt').chunks).text())
Electron and asar files

In Electron, the fs module is changed: a file with a name that ends in .asar is a directory. With that module, extract() does not write an app.asar entry as a file, and create() reads the paths in the asar file and not the file. Electron has the module original-fs, which is node:fs with no change. Give it as the fs option.

An async command needs the functions that return promises: originalFs.promises. A sync command needs originalFs.

This example is for the main process of Electron. It is not tested, because the tests of this package do not run in Electron.

import originalFs from 'original-fs'
import { create, extract, extractSync } from 'tar'

await create({ file: 'app.tgz', gzip: true, fs: originalFs.promises }, [
  'MyApp.app',
])
await extract({ file: 'app.tgz', cwd: 'out', fs: originalFs.promises })
extractSync({ file: 'app.tgz', cwd: 'out', fs: originalFs })
The process options

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm tar

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Frame 2085668439 (1)
Group 1261154229