Skip to content

Fixes CVE-2026-56018, where we leaked memory on each minification.#13

Merged
bleargh45 merged 1 commit into
mainfrom
bleargh.address-cve-2026-56018
Jun 28, 2026
Merged

Fixes CVE-2026-56018, where we leaked memory on each minification.#13
bleargh45 merged 1 commit into
mainfrom
bleargh.address-cve-2026-56018

Conversation

@bleargh45

@bleargh45 bleargh45 commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Thanks to drclaw1394 and CPANSec for reporting, and for suggestions on
where to address.

CVE-2026-56018:

JavaScript::Minifier::XS unbounded memory growth

Root-caused: in JsMinify the cleanup (XS.xs:742-750) frees only the NodeSet structs, never the per-node contents buffers (Newz'd in JsSetNodeContents, XS.xs:261); JsDiscardNode only unlinks. So every token's contents leaks on every minify() call. (The two if (!head) return NULL early-returns also leak the whole ~2 MB NodeSet.)

Closes #10.

Thanks to drclaw1394 and CPANSec for reporting, and for suggestions on
where to address.

> CVE-2026-56018:
>
> JavaScript::Minifier::XS unbounded memory growth
>
> Root-caused: in JsMinify the cleanup (XS.xs:742-750) frees only the NodeSet structs, never the per-node contents buffers (Newz'd in JsSetNodeContents, XS.xs:261); JsDiscardNode only unlinks. So every token's contents leaks on every minify() call. (The two if (!head) return NULL early-returns also leak the whole ~2 MB NodeSet.)

Closes #10.
@bleargh45 bleargh45 force-pushed the bleargh.address-cve-2026-56018 branch from a07ed0a to 1fda487 Compare June 28, 2026 20:52
@bleargh45 bleargh45 merged commit 939c969 into main Jun 28, 2026
40 checks passed
@bleargh45 bleargh45 deleted the bleargh.address-cve-2026-56018 branch June 28, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unbound memory growth when calling minify

1 participant