Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-109380 Overview
CVE-2026-109380 is a memory exhaustion vulnerability in the modern-tar JavaScript library, affecting versions 0.3.5 through 0.8.5. The flaw resides in the readOctal() function within the tar encoding module. Attackers can craft a tar archive, optionally gzip-compressed, that contains non-octal bytes in the size field. When parsed, these bytes produce negative entry sizes. The unpackTar() function then buffers chunks indefinitely, exhausting process memory and suppressing subsequent entries. The vulnerability is tracked under [CWE-1284: Improper Validation of Specified Quantity in Input].
Critical Impact
Remote attackers can trigger denial of service by supplying a crafted tar archive to any application using a vulnerable version of modern-tar, causing unbounded memory consumption.
Affected Products
- modern-tar version 0.3.5
- modern-tar versions through 0.8.5
- Applications and services ingesting untrusted tar or gzip-compressed tar archives via unpackTar()
Discovery Timeline
- 2026-10-12 - CVE-2026-109380 published to NVD
- 2026-10-13 - Last updated in NVD database
Technical Details for CVE-2026-109380
Vulnerability Analysis
The modern-tar library parses tar header fields using the readOctal() function in src/tar/encoding.ts. Tar size fields are defined as octal digits terminated by NUL or whitespace. The vulnerable implementation iterates over bytes and multiplies the accumulator by eight, adding charCode - 48 for each byte. The parser does not reject bytes outside the octal range (0–7, ASCII 48–55). When an attacker supplies bytes below ASCII 48, the subtraction yields a negative contribution. The resulting size can become negative or otherwise invalid. Downstream logic in unpackTar() relies on this value to bound chunk buffering. With a corrupt size, the unpacker buffers data without terminating, consuming all available process memory.
Root Cause
The root cause is missing input validation in the octal parser. Bytes between NUL and the ASCII digit range are neither skipped nor rejected. The accumulator can therefore underflow into negative territory, violating the invariant that tar sizes are non-negative integers.
Attack Vector
An attacker crafts a tar archive with malformed bytes in the size field of any entry header. The archive may be gzip-compressed to further reduce transmission size and amplify impact. The attacker delivers the archive to any application that calls unpackTar() on untrusted input. No authentication or user interaction is required.
// Security patch in src/tar/encoding.ts
// fix(tar): reject malformed octal fields (#195)
const charCode = view[i];
if (charCode === 0) break; // Stop at NUL terminator
if (charCode === 32) continue; // Ignore whitespace
+ if (charCode < 48 || charCode > 55) throw new Error("Invalid tar number.");
value = value * 8 + (charCode - 48); // 48 is ASCII '0'
}
Source: GitHub Commit #181c8cb. The patch rejects any byte outside the octal digit range by throwing Invalid tar number. before the accumulator can be corrupted.
Detection Methods for CVE-2026-109380
Indicators of Compromise
- Node.js or JavaScript runtime processes exhibiting rapid, unbounded memory growth while handling tar or .tar.gz uploads
- Process crashes with out-of-memory (OOM) errors shortly after receiving an archive from an untrusted source
- Truncated extraction output where later entries in an archive are silently suppressed
- Inbound tar archives with non-octal bytes in header size fields (offsets 124–135 of each 512-byte header block)
Detection Strategies
- Perform dependency scanning on package.json and lockfiles for modern-tar versions 0.3.5 through 0.8.5
- Instrument archive-ingesting endpoints to log entry sizes parsed from tar headers and alert on negative or implausibly large values
- Monitor runtime memory metrics on services that accept user-supplied archives and alert on sudden heap growth preceding OOM termination
- Use software composition analysis (SCA) tooling to flag transitive dependencies pulling in vulnerable modern-tar releases
Monitoring Recommendations
- Track per-process resident set size (RSS) and heap usage for upload handlers and archive processors
- Enable structured logging of archive filenames, sources, and parsing errors to correlate OOM events with suspect inputs
- Forward application and container OOMKilled events to a centralized logging platform for correlation across the fleet
How to Mitigate CVE-2026-109380
Immediate Actions Required
- Upgrade modern-tar to a release that includes commit 181c8cb which rejects malformed octal fields
- Audit all services that accept user-supplied tar or gzip-compressed tar archives and prioritize patching internet-facing endpoints
- Enforce request-size limits and per-process memory limits on handlers that invoke unpackTar()
- Review build pipelines and container images for pinned vulnerable versions of modern-tar
Patch Information
The fix is implemented in GitHub Pull Request #195 and merged as commit 181c8cb. The patch adds a validation check in readOctal() that throws Invalid tar number. when any byte falls outside the ASCII octal digit range (48–55). Refer to the VulnCheck Advisory on Modern Tar for the full advisory.
Workarounds
- Run archive-processing code in isolated worker processes with hard memory limits so an OOM condition does not impact the parent service
- Reject archives from untrusted sources at the network edge until the upgrade is deployed
- Add a pre-validation step that inspects tar header size fields and discards archives containing non-octal bytes before invoking unpackTar()
# Upgrade modern-tar to a patched release
npm install modern-tar@latest
# Verify no vulnerable versions remain in the dependency tree
npm ls modern-tar
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

