HIGH 7.5

CVE-2026-56017: JavaScript::Minifier::XS NULL Pointer Denial of Service

JavaScript::Minifier::XS, a Perl module used to compress JavaScript code, contains a critical flaw that causes immediate crashes when processing certain malformed input. Specifically, if the first substantive character in JavaScript code is a forward slash, the minifier's code reading logic attempts to access memory that doesn't exist, crashing the entire application. An attacker can exploit this by sending a single slash character to any service that uses this library to minify untrusted JavaScript, resulting in a denial of service attack. The vulnerability affects all versions before 0.16.

Source data · NVD / CISA · public domain

CVSS
3.1 · 7.5 HIGH · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-125, CWE-476
Affected products
0 configuration(s)
Published / Modified
2026-06-29 / 2026-06-30

NVD description (verbatim)

JavaScript::Minifier::XS versions before 0.16 for Perl crash with a NULL pointer dereference when the first meaningful token of the input is a slash. The regexp versus division disambiguator in JsTokenizeString (XS.xs) inspects the previous token's last byte to choose between a regexp literal and a division operator. When a slash is the first meaningful token, with the start of input or only whitespace and comments before it, there is no valid preceding token: the walk back over whitespace and comment nodes runs off the head of the node list to NULL, and the byte lookup reads through a NULL contents pointer at an underflowed length index. The following identifier check dereferences the same NULL pointer. The crash is reachable through the public minify() API, so input as small as a single slash byte crashes the calling process. A service that minifies untrusted or third-party JavaScript can be crashed by a remote request, causing denial of service.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The vulnerability stems from improper bounds checking in the JsTokenizeString function within XS.xs. The minifier uses a disambiguator to distinguish between regular expression literals and division operators by examining the preceding token's final byte. When a slash character appears as the first meaningful token—with only whitespace, comments, or the start of input before it—the code attempts to walk backward through a linked list of tokens to find context. This backward walk fails to validate that it has reached the list head, allowing the pointer to dereference NULL memory. Subsequently, an identifier check on the same NULL pointer triggers a crash. The defect is reachable via the public minify() API without authentication or special privileges, making exploitation trivial.

Business impact

Organizations running web services, build pipelines, or CDN-like infrastructure that minify untrusted or user-supplied JavaScript are at immediate risk. A single malicious request containing a slash character can crash worker processes, creating a straightforward denial-of-service vector. For services handling JavaScript from third-party sources—ad networks, script repositories, user-uploaded code—this becomes a scalability and availability concern. Repeated crashes could degrade service responsiveness or trigger cascading failures in dependent systems. The low barrier to exploitation (a single byte) means automated scanning and exploitation tooling could rapidly target affected infrastructure.

Affected systems

JavaScript::Minifier::XS versions 0.15 and earlier are vulnerable. Any Perl application, service, or middleware that directly invokes the minify() function on untrusted input is at risk. This includes web frameworks, asset pipelines, build tools, and security scanning systems that may parse and compress JavaScript. End-user impact depends on deployment context: a development machine running the module is vulnerable, as is a production web service. Organizations should inventory Perl dependencies and check for this module's presence in their environment.

Exploitability

Exploitation requires only that a vulnerable version of JavaScript::Minifier::XS be installed and accessible to process attacker-controlled input via the minify() function. No authentication, special privileges, user interaction, or complex payloads are required. An attacker can craft a request as small as a single byte (the `/` character) to trigger the crash. The CVSS score of 7.5 reflects the high exploitability (CVSS:3.1/AV:N/AC:L/PR:N/UI:N) tempered only by the impact being availability (no confidentiality or integrity loss). Real-world exploitation is practical and low-cost; no prior knowledge of the target system's exact configuration is needed.

Remediation

Upgrade JavaScript::Minifier::XS to version 0.16 or later, which includes a fix for the NULL pointer dereference. Review your Perl module inventory using package managers (CPAN, cpanm, or system package tools) to identify affected installations. For services that cannot immediately patch, implement input validation to reject or sanitize JavaScript starting with a slash when preceded only by whitespace or comments; however, this is a temporary workaround and not a substitute for patching. Test the upgrade in a staging environment before deploying to production to confirm compatibility with your minification workflow.

Patch guidance

Verify that JavaScript::Minifier::XS version 0.16 or later is installed. Use `perl -MJavaScript::Minifier::XS -e 'print $JavaScript::Minifier::XS::VERSION'` or consult your CPAN or package manager metadata to confirm the current version. Update using cpanm: `cpanm --upgrade JavaScript::Minifier::XS`, or use your system's package manager if the module is distributed that way. After upgrading, re-run your test suite, particularly any tests that exercise JavaScript minification, to ensure no regressions. Monitor application logs for any minification-related errors during the rollout.

Detection guidance

Review application and service logs for crashes or segmentation faults in Perl processes that handle JavaScript minification. Look for error messages referencing JsTokenizeString or NULL pointer dereference. If you have access to source or build artifacts, grep for `JavaScript::Minifier::XS` in dependency manifests (Makefile.PL, cpanfile, etc.) to identify deployment scope. Network intrusion detection systems may flag requests containing unusual or minimal JavaScript payloads sent to minification endpoints, though a single slash character is benign in isolation and difficult to detect behaviorally. Manual code review of applications using this module will confirm exposure.

Why prioritize this

This vulnerability merits immediate attention because exploitability is trivial (single-byte input), the attack surface is broad (any service minifying untrusted code), and the impact is direct (denial of service with no warning). The CVSS 7.5 HIGH rating and straightforward fix (upgrade to 0.16) make this a high-priority remediation. Even if your organization does not directly develop Perl applications, check whether third-party dependencies or build tooling indirectly rely on this module. For development teams using modern CI/CD pipelines that minify assets, this is a critical blocking issue.

Risk score, explained

The CVSS 3.1 score of 7.5 (HIGH) is derived from: (1) network-accessible attack vector (AV:N), (2) low complexity with no special conditions required (AC:L), (3) no privileges needed (PR:N), (4) no user interaction (UI:N), and (5) bounded scope to the vulnerable component (S:U), with high impact on availability (A:H). The lack of confidentiality and integrity impact prevents a CRITICAL rating, but the combination of instant exploitability and easy-to-trigger crash justifies a HIGH score. Organizations should treat this as urgent, not deferred.

Frequently asked questions

Do I need to be running Perl directly to be vulnerable?

No. Any service or framework that embeds or calls the JavaScript::Minifier::XS module—including via Perl-based web frameworks, asset pipelines, or containerized tooling—is affected. Check your dependency tree for the presence of this module, even if Perl is not your primary language.

Can I work around this without upgrading?

Input validation that rejects or escapes JavaScript starting with a slash is a temporary mitigation, but it is not a reliable substitute for patching. The best course is to upgrade to version 0.16 as soon as possible. A temporary band-aid may reduce risk while you plan your upgrade.

Will my JavaScript minification still work after upgrading to 0.16?

Yes. Version 0.16 fixes the crash without changing the minification algorithm or output. Testing in a staging environment before production deployment is recommended, but breakage is unlikely.

How do I check what version of JavaScript::Minifier::XS I have?

Run `perl -MJavaScript::Minifier::XS -e 'print $JavaScript::Minifier::XS::VERSION'` from a shell, or inspect your CPAN or package manager metadata. You can also list installed Perl modules with tools like `cpanm -l` or `perldoc perllocal`.

This analysis is provided for informational and defensive purposes. SEC.co does not develop or maintain JavaScript::Minifier::XS; refer to the official CPAN repository and vendor security advisories for authoritative patch information and compatibility details. Exploitation of vulnerabilities in production systems without authorization is illegal. Organizations should verify patch applicability and test thoroughly in non-production environments before deploying updates to critical systems. This vulnerability intelligence should not be construed as legal or compliance advice; consult your security and legal teams for guidance specific to your regulatory and business context. Source: NVD (public-domain), retrieved 2026-08-08. Analysis generated by SEC.co (claude-haiku-4-5).