Skip to main content

JavaScript::Minifier::XS CVE-2026-56018

| EUVDEUVD-2026-40182 HIGH
Memory Leak (CWE-401)
2026-06-29 CPANSec GHSA-fvxv-8c37-qrc6
7.5
CVSS 3.1 · Vendor: CPANSec
Share

Severity by source

Vendor (CPANSec) PRIMARY
7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI
7.5 HIGH

Network-reachable when used in a minifier endpoint, no auth or interaction, and the per-call leak yields availability-only impact (C/I:N, A:H); AC:L since any repeated normal call triggers it.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE
5.9 MEDIUM
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H

Primary rating from Vendor (CPANSec).

CVSS VectorVendor: CPANSec

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

4
Analysis Generated
Jun 29, 2026 - 22:30 vuln.today
Patch available
Jun 29, 2026 - 22:02 EUVD
CVSS changed
Jun 29, 2026 - 21:22 NVD
7.5 (HIGH)
CVE Published
Jun 29, 2026 - 19:38 cve.org
UNKNOWN (no severity yet)

DescriptionCVE.org

JavaScript::Minifier::XS versions before 0.16 for Perl leak memory on every call to minify(), allowing unbounded memory growth.

In JsMinify (XS.xs) the cleanup frees only the NodeSet structures and never the per-token contents buffers allocated in JsSetNodeContents; JsDiscardNode unlinks nodes without freeing their contents. Each token's contents buffer is therefore leaked on every call, and the two early returns taken when the node list is empty leak the whole NodeSet.

A long-lived process that minifies repeatedly, such as an asset pipeline or a server-side minifier endpoint, grows in memory without bound until it exhausts available memory and is killed, causing denial of service.

AnalysisAI

Uncontrolled memory consumption in the Perl module JavaScript::Minifier::XS before version 0.16 lets remote attackers exhaust a long-lived process's memory by repeatedly triggering minify() calls. The XS cleanup code frees only the NodeSet structures while leaking every per-token contents buffer (and the entire NodeSet on the empty-list early-return paths), so each invocation leaks heap memory until the process is OOM-killed. CISA's SSVC marks exploitation as automatable with partial technical impact; no public exploit has been identified and it is not in CISA KEV, though the leak is trivially reachable in any service that minifies attacker-supplied JavaScript.

Technical ContextAI

JavaScript::Minifier::XS is a Perl distribution (CPAN, author GTERMARS, CPE gtermars:javascript::minifier::xs) that wraps a C/XS minification engine for speed. The defect is in JsMinify within XS.xs: tokenization allocates a per-token contents buffer via JsSetNodeContents, but the teardown only frees the NodeSet node structures, and JsDiscardNode unlinks nodes without releasing their attached contents buffers. This is a classic CWE-401 Missing Release of Memory After Effective Lifetime - the owning pointers to the contents buffers are dropped without free(), so the allocations become unreachable and accumulate. Two early-return branches taken when the node list is empty compound the issue by leaking the whole NodeSet allocation. Because the leak is per-call rather than a fixed one-time cost, total leaked memory scales linearly with request volume.

RemediationAI

Vendor-released patch: upgrade to JavaScript::Minifier::XS 0.16 or later, which adds the missing frees for the per-token contents buffers and the empty-list NodeSet paths (see the 0.16 changelog at https://metacpan.org/release/GTERMARS/JavaScript-Minifier-XS-0.16/changes and the upstream issue at https://github.com/bleargh45/JavaScript-Minifier-XS/issues/10). If you cannot upgrade immediately, mitigate the unbounded growth operationally: cap process lifetime by recycling minifier workers after a fixed number of requests (e.g., a worker-max-requests setting), enforce a per-process memory limit with a supervisor or cgroup so an OOM kill is contained and the process is auto-restarted rather than dragging down the host, or move minification to a short-lived child process per batch so leaked memory is reclaimed on exit. The trade-off of worker recycling and short-lived processes is added latency/CPU from re-spawning; the trade-off of a hard memory cap is intermittent request failures when the limit is hit. The oss-security advisory is at https://seclists.org/oss-sec/2026/q2/1066.

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
openSUSE Tumbleweed Fixed

Share

CVE-2026-56018 vulnerability details – vuln.today

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy