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-78497 Overview
CVE-2026-78497 is a code injection vulnerability [CWE-95] in the JQ::Lite Perl module versions prior to 2.51. The module compiles user-supplied regular expression patterns using string eval, which allows embedded Perl (?{ ... }) code blocks to execute during pattern compilation. Attackers who control the pattern passed to test(), match(), or the match and =~ conditions of select() can run arbitrary Perl code in the calling process. The flaw exists because single-quote escaping does not neutralize inline code blocks, which execute without requiring use re 'eval'.
Critical Impact
Arbitrary Perl code execution in the context of any application that passes untrusted input into a JQ::Lite query regex.
Affected Products
- JQ::Lite Perl module versions prior to 2.51
- Perl applications that forward user input into JQ::Lite query patterns
- CPAN distributions depending on vulnerable JQ::Lite releases
Discovery Timeline
- 2026-10-18 - CVE-2026-78497 published to NVD
- 2026-10-18 - OSS-Security list disclosure published
- 2026-10-20 - Last updated in NVD database
Technical Details for CVE-2026-78497
Vulnerability Analysis
The vulnerability resides in lib/JQ/Lite/Util/Transform.pm, where the module builds a regular expression from an attacker-controlled pattern. The pre-patch code constructs a string of the form qr'$escaped'$modifiers and passes it to Perl's string eval. Because eval treats its argument as source text, any embedded (?{ ... }) construct is parsed and executed as Perl code during compilation. The single-quote escaping routine prevents breaking out of the qr'...' literal, but it does not strip or sanitize code-block constructs, which do not require quoting to execute.
Exploitation yields full Perl code execution in the host process, exposing filesystem access, network operations, and secrets held in memory.
Root Cause
The root cause is use of string eval to compile a dynamically assembled regex source. Perl normally refuses to execute (?{ ... }) code blocks inside interpolated patterns unless use re 'eval' is active. However, when the pattern is compiled as source via eval "qr'...'", the code block is part of the lexical source and runs without that restriction.
Attack Vector
An attacker supplies a JQ::Lite query containing a test(), match(), or select() expression whose regex pattern includes a (?{ ... }) block. When the application compiles the query, the embedded Perl executes immediately. Any application accepting query strings, JSON filter expressions, or regex fragments from external input is exposed.
# Patch: lib/JQ/Lite/Util/Transform.pm
$modifiers .= $flag;
}
- my $escaped = $pattern;
- $escaped =~ s/'/\\'/g;
-
- my $regex = eval "qr'$escaped'$modifiers";
+ my $regex = eval { qr/(?$modifiers:$pattern)/ };
if ($@) {
return (undef, $@);
}
Source: GitHub Commit Patch. The fix replaces string eval with a block eval and uses an interpolated qr// with inline modifiers, so patterns are compiled as data rather than source text. This prevents (?{ ... }) blocks from executing without use re 'eval'.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2026-78497
Indicators of Compromise
- Perl process spawning unexpected child processes (sh, curl, wget, perl -e) after handling JQ::Lite queries
- Log entries containing regex patterns with (?{ or (??{ constructs submitted to application endpoints
- Outbound network connections initiated from Perl worker processes to unknown hosts
Detection Strategies
- Audit application code for calls into JQ::Lite where query strings or regex fragments originate from HTTP parameters, message queues, or files
- Inspect installed CPAN inventories for JQ-Lite versions below 2.51 using cpanm --info JQ::Lite or packaging tooling
- Add web application firewall rules that reject request parameters containing (?{ or (??{ sequences
Monitoring Recommendations
- Enable process-lineage telemetry on hosts running Perl services to flag anomalous children of perl processes
- Monitor filesystem writes and network egress from application accounts that run JQ::Lite workloads
- Alert on changes to CPAN module versions in production hosts to catch unpatched regressions
How to Mitigate CVE-2026-78497
Immediate Actions Required
- Upgrade JQ::Lite to version 2.51 or later on every system where the module is installed
- Inventory applications that pass external input into test(), match(), or select() regex conditions and restrict that input
- Rotate secrets accessible to any Perl process that may have processed attacker-controlled queries while vulnerable
Patch Information
The fix landed in commit c461721ae3d5a90d6d94dbb234c1b8dfee5c1769 and is included in JQ::Lite 2.51, published on CPAN. See the MetaCPAN Release Changes and the OpenWall OSS-Security advisory for details. The patched compilation path uses a block eval with an interpolated qr// so patterns are treated as data.
Workarounds
- Reject or sanitize query inputs that contain (?{, (??{, or similar Perl code-block regex constructs before passing them to JQ::Lite
- Run Perl services that invoke JQ::Lite under a restricted user with no shell, limited filesystem access, and no outbound network privileges
- Wrap calls to vulnerable JQ::Lite APIs in a validation layer that only permits a whitelisted regex grammar
# Upgrade JQ::Lite to the patched release
cpanm JQ::Lite@2.51
# Verify installed version
perl -MJQ::Lite -e 'print $JQ::Lite::VERSION, "\n"'
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

