CVE-2025-64118
node-tar vulnerable to race condition leading to uninitialized memory exposure
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- High
- Privileges needed
- Low
- User interaction
- Passive
What an attacker can affect
- Confidentiality
- High
- Integrity
- Low
- Availability
- Low
Exploit likelihood
What each source reports
CVE List Score used
6.1
node-tar vulnerable to race condition leading to uninitialized memory exposure
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
- Record
CVE-2025-64118- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Weakness
- CWE-362, CWE-367
- Updated
- 2026-11-02
EUVDEUVD-2025-37034
6.1
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
- Record
EUVD-2025-37034- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-29xp-372q-xqph
6.1
node-tar has a race condition leading to uninitialized memory exposure
Summary
Using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read.
Details
See:
- https://github.com/isaacs/node-tar/issues/445
- https://github.com/isaacs/node-tar/pull/446
- Regression happened in https://github.com/isaacs/node-tar/commit/5330eb04bc43014f216e5c271b40d5c00d45224d
PoC
A:
import * as tar from 'tar'
import fs from 'node:fs'
fs.writeFileSync('tar.test.tmp', Buffer.alloc(1*1024))
// from readme
const filesAdded = []
tar.c(
{
sync: true,
file: 'tar.test.tmp.tar',
onWriteEntry(entry) {
// initially, it's uppercase and 0o644
console.log('adding', entry.path, entry.stat.mode.toString(8))
// make all the paths lowercase
entry.path = entry.path.toLowerCase()
// make the entry executable
entry.stat.mode = 0o755
// in the archive, it's lowercase and 0o755
filesAdded.push([entry.path, entry.stat.mode.toString(8)])
},
},
['./tar.test.tmp'],
)
const a = fs.readFileSync('tar.test.tmp.tar')
for (let i = 0; ; i++){
if (i % 10000 === 0) console.log(i)
fs.writeFileSync('tar.test.tmp.tar', a)
fs.truncateSync('tar.test.tmp.tar', 600)
}
B (vulnerable):
import * as tar from 'tar'
import * as fs from 'fs'
while (true) {
fs.readFileSync(import.meta.filename)
tar.t({
sync: true,
file: 'tar.test.tmp.tar',
onReadEntry: e => e.on('data', b => {
const a = b.filter(x => x)
if (a.length > 0) console.log(a.toString())
})
})
}
Run A and B in parallel on Node.js 22 or >=25.1.0
Dumps B memory (wait for some time to observe text data)
Impact
Exposes process memory and could result in e.g. unintentionally (aka attacker-controlled) attempting to process sensitive data rather than tar entry contents. Uninitialized memory can contain unrelated file contents, environment variables, passwords, etc.
To execute, an attacker must reduce the file size to boundary between a tar header and body block, in the time between when the tar archive file size is read via stat, and the time when the tar archive parser reaches the entry that is truncated. If the file is truncated at a different boundary, then the uninitialized data will very likely not be a valid tar entry, causing the parser to treat the entry as a damaged archive (that is, throwing an error in strict: true mode, or by default, skipping the entry harmlessly).
This is conditional on using the sync: true option to the tar.list/tar.t method, and the 7.5.1 version specifically. Earlier versions were not affected.
This is also conditional to attacker being able to truncate (or induce a truncation/replacement) of a file on disk (e.g. in cache).
If the tar file is initially larger than the opt.maxReadSize (16kb by default), then uninitialized memory is not exposed to user code, and instead the program enters an infinite loop, causing a DoS rather than an information disclosure vulnerability.
By default, tar.list does not process tar archive entry body content. So, this is further conditional on the user code doing something with the tar entry file contents in an onReadEntry method which would expose the file contents (for example, attempting to parse them in such a way that the uninitialized data could appear in an error message).
Other methods in this library (tar.extract, etc.) are not affected by this vulnerability.
- Record
GHSA-29xp-372q-xqph- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Weakness
- CWE-362
- Updated
- 2026-11-02
NVD
6.1
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
- Record
CVE-2025-64118- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-362, CWE-367
- Updated
- 2026-11-02
OSV
6.1
node-tar vulnerable to race condition leading to uninitialized memory exposure
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
- Record
CVE-2025-64118- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Weakness
- CWE-362, CWE-367
- Updated
- 2026-11-02
OSVGHSA-29xp-372q-xqph
6.1
node-tar has a race condition leading to uninitialized memory exposure
Summary
Using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read.
Details
See:
- https://github.com/isaacs/node-tar/issues/445
- https://github.com/isaacs/node-tar/pull/446
- Regression happened in https://github.com/isaacs/node-tar/commit/5330eb04bc43014f216e5c271b40d5c00d45224d
PoC
A:
import * as tar from 'tar'
import fs from 'node:fs'
fs.writeFileSync('tar.test.tmp', Buffer.alloc(1*1024))
// from readme
const filesAdded = []
tar.c(
{
sync: true,
file: 'tar.test.tmp.tar',
onWriteEntry(entry) {
// initially, it's uppercase and 0o644
console.log('adding', entry.path, entry.stat.mode.toString(8))
// make all the paths lowercase
entry.path = entry.path.toLowerCase()
// make the entry executable
entry.stat.mode = 0o755
// in the archive, it's lowercase and 0o755
filesAdded.push([entry.path, entry.stat.mode.toString(8)])
},
},
['./tar.test.tmp'],
)
const a = fs.readFileSync('tar.test.tmp.tar')
for (let i = 0; ; i++){
if (i % 10000 === 0) console.log(i)
fs.writeFileSync('tar.test.tmp.tar', a)
fs.truncateSync('tar.test.tmp.tar', 600)
}
B (vulnerable):
import * as tar from 'tar'
import * as fs from 'fs'
while (true) {
fs.readFileSync(import.meta.filename)
tar.t({
sync: true,
file: 'tar.test.tmp.tar',
onReadEntry: e => e.on('data', b => {
const a = b.filter(x => x)
if (a.length > 0) console.log(a.toString())
})
})
}
Run A and B in parallel on Node.js 22 or >=25.1.0
Dumps B memory (wait for some time to observe text data)
Impact
Exposes process memory and could result in e.g. unintentionally (aka attacker-controlled) attempting to process sensitive data rather than tar entry contents. Uninitialized memory can contain unrelated file contents, environment variables, passwords, etc.
To execute, an attacker must reduce the file size to boundary between a tar header and body block, in the time between when the tar archive file size is read via stat, and the time when the tar archive parser reaches the entry that is truncated. If the file is truncated at a different boundary, then the uninitialized data will very likely not be a valid tar entry, causing the parser to treat the entry as a damaged archive (that is, throwing an error in strict: true mode, or by default, skipping the entry harmlessly).
This is conditional on using the sync: true option to the tar.list/tar.t method, and the 7.5.1 version specifically. Earlier versions were not affected.
This is also conditional to attacker being able to truncate (or induce a truncation/replacement) of a file on disk (e.g. in cache).
If the tar file is initially larger than the opt.maxReadSize (16kb by default), then uninitialized memory is not exposed to user code, and instead the program enters an infinite loop, causing a DoS rather than an information disclosure vulnerability.
By default, tar.list does not process tar archive entry body content. So, this is further conditional on the user code doing something with the tar entry file contents in an onReadEntry method which would expose the file contents (for example, attempting to parse them in such a way that the uninitialized data could appear in an error message).
Other methods in this library (tar.extract, etc.) are not affected by this vulnerability.
- Record
GHSA-29xp-372q-xqph- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Weakness
- CWE-362
- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2025-64118
4.7
CVE-2025-64118 in tar - Patched by Root
Root has patched CVE-2025-64118 in the tar package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2025-64118- CVSS 3.1
- 4.7 Medium
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2025-64118
6.1
node-tar is a Tar for Node.js. In 7.5.1, using .t (aka .list) with { sync: true } to read tar entry contents returns uninitialized memory contents if tar file was changed on disk to a smaller size while being read. This vulnerability is fixed in 7.5.2.
- Record
UBUNTU-CVE-2025-64118- CVSS 4.0
- 6.1 Medium
CVSS:4.0/AV:L/AC:H/AT:P/PR:L/UI:P/VC:H/VI:L/VA:L/SC:H/SI:H/SA:H - Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
tarnpm |
7.5.1 to 7.5.1 | 7.5.2 |
tarnpm |
7.5.1 up to 7.5.2 | 7.5.2 |
tarRoot:npm |
before 7.5.1-aikido.12 | 7.5.1-aikido.127.5.1-aikido.97.5.1-aikido.107.5.1-aikido.11 |
@rootio/tarRoot:npm |
before 7.5.1-root.io.1 | 7.5.1-root.io.17.5.1-root.io.27.5.1-root.io.37.5.1-root.io.47.5.1-root.io.57.5.1-root.io.67.5.1-root.io.77.5.1-root.io.87.5.1-root.io.127.5.1-root.io.97.5.1-root.io.107.5.1-root.io.11 |
node-tarUbuntu:Pro:14.04:LTS |
All versions, plus listed versions 0.1.18-10.1.18-1ubuntu0.1~esm1 |
None known |
node-tarUbuntu:Pro:16.04:LTS |
All versions, plus listed versions 1.0.3-21.0.3-2ubuntu0.1~esm1 |
None known |
node-tarUbuntu:18.04:LTS |
All versions, plus listed versions 2.2.1-1 |
None known |
node-tarUbuntu:Pro:20.04:LTS |
All versions, plus listed versions 4.4.10+ds1-24.4.10+ds1-2ubuntu14.4.10+ds1-2ubuntu1+esm1 |
None known |
node-tarUbuntu:22.04:LTS |
All versions, plus listed versions 6.1.7+~cs11.3.10-16.1.11+~cs11.3.10-16.1.11+ds1+~cs6.0.6-1 |
None known |
node-tarUbuntu:24.04:LTS |
All versions, plus listed versions 6.1.13+~cs7.0.5-16.1.13+~cs7.0.5-3 |
None known |
node-tarUbuntu:25.10 |
All versions, plus listed versions 6.2.1+~cs7.0.8-1 |
None known |
node-tarUbuntu:26.10 |
All versions, plus listed versions 6.2.1+ds1+~cs6.1.13-107.5.22+~4.0.1-1 |
None known |
node-tarUbuntu:26.04:LTS |
All versions, plus listed versions 6.2.1+~cs7.0.8-16.2.1+ds1+~cs6.1.13-66.2.1+ds1+~cs6.1.13-76.2.1+ds1+~cs6.1.13-10 |
None known |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2025-64118 is a medium vulnerability (CVSS 6.1) in Isaacs Node-tar, published October 30, 2025. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.13%, the 2nd percentile. Fixed in tar 7.5.2.
References
github.com/isaacs/node-tar/security/advisories/GHSA-29xp-372q-xqph
github.com/isaacs/node-tar/issues/445
github.com/isaacs/node-tar/pull/446
github.com/isaacs/node-tar/commit/5330eb04bc43014f216e5c271b40d5c00d45224d
github.com/isaacs/node-tar/commit/5e1a8e638600d3c3a2969b4de6a6ec44fa8d74c9
nvd.nist.gov/vuln/detail/CVE-2025-64118