/

CVE-2026-48962

Severity:

HIGH RISK

(7.3)

Code Injection via Dynamic Evaluation in Perl IO::Compress

CVE-2026-48962

Deferred

Vulnerability type

Category:

Code Injection via Dynamic Evaluation

CWE:

CWE-95, CWE-94

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

IO::Compress before 2.220 allows attacker-controlled output glob strings to be evaluated as Perl code inside File::GlobMapper.

By injecting a double quote into the output glob, an attacker can break out of the intended string context and execute arbitrary Perl code with the privileges of the calling process.

Affected context

This vulnerability appears when applications use IO::Compress with File::GlobMapper and pass output glob patterns that are derived from untrusted or partially untrusted input.

The issue is specific to code paths where _parseOutputGlob() processes a user-controlled glob, stores it in parser state, and _getFiles() later evaluates that state with eval STRING.

Systems that strictly generate output globs from hard-coded or validated-safe patterns are less likely to be exposed, but any dynamic construction that incorporates external data may introduce risk.

Exploit preconditions

  • Attack surface: Any Perl application using IO::Compress:: File::GlobMapper with dynamic output glob patterns
  • Required access: Ability to influence or control the value passed as the output glob (e.g., via CLI arguments, configuration files, environment variables, or web parameters)
  • Trigger point: Execution of code paths that call _parseOutputGlob() on the attacker-controlled glob and subsequently invoke _getFiles()
  • Why exploitation is possible: The implementation wraps the caller-supplied glob in double quotes, stores it, and later feeds it into eval STRING. An embedded double quote breaks the wrapper and lets the attacker inject arbitrary Perl code, which eval executes as part of the expression.

Why this happens

The core issue is the use of eval STRING on data derived from external input, a classic instance of CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').

_parseOutputGlob() attempts to treat the glob as a string expression by wrapping it in double quotes, but it does not neutralize or restrict embedded quotes or Perl metacharacters.

When _getFiles() later passes this wrapped expression to eval STRING, any injected double quote closes the string literal and allows arbitrary Perl code to follow.

This pattern conflates data (glob patterns) with code, violating the principle of separating untrusted input from dynamic evaluation mechanisms.

Potential impact

  • Arbitrary Perl code execution in the context of the vulnerable process
  • Reading or modifying sensitive files accessible to the application
  • Exfiltration or tampering with application data and configuration
  • Pivoting to other components or systems reachable from the compromised process
  • Denial of service by terminating the process or exhausting resources

General mitigation guidance

Effective mitigation focuses on removing the dependency on eval STRING for handling glob expressions and strictly treating glob patterns as data.

Recommended secure patterns include:

  • Avoiding dynamic evaluation entirely: use dedicated globbing and path-handling APIs rather than constructing Perl expressions.
  • Treating glob patterns as opaque data: do not interpolate them into code or expression strings; pass them to functions that interpret glob syntax without executing Perl.
  • Constraining inputs: if dynamic globs are necessary, validate them against a strict whitelist of allowed characters (e.g., alphanumerics, limited wildcard characters) and reject or escape quotes and Perl metacharacters.
  • Applying least privilege: run Perl applications with minimal filesystem and OS permissions so that, even if a glob behaves unexpectedly, the process has limited access.
  • Isolating risky parsing: where dynamic behavior is unavoidable, consider isolating it in a separate, locked-down process or environment to reduce blast radius.

How teams detect issues like this

Detection efforts can focus on identifying unsafe dynamic evaluation patterns and risky use of globbing utilities:

  • Static analysis: Search for eval usages that operate on strings built from variables or external input, especially in IO::Compress and File::GlobMapper call sites.
  • Code review cues: Flag any code that:
  • Constructs Perl expressions by concatenating user input into strings.
  • Wraps user-controlled values in quotes and later passes them to eval.
  • Treats glob patterns as code rather than data.
  • Policy enforcement: Adopt coding standards that discourage or forbid eval STRING unless rigorously justified and reviewed. Integrate these standards into CI using linters or custom rules.
  • Runtime monitoring: Where feasible, log and monitor suspicious output glob patterns or unexpected errors arising from eval, which may indicate attempted injection.

Sources

SourceLink
github.comgithub.com/pmqs/IO-Compress/commit/f2db247bf90d4cc7ee2710be384946081f3b4610.patch
metacpan.orgmetacpan.org/release/PMQS/IO-Compress-2.220/changes
openwall.comopenwall.com/lists/oss-security/2026/05/27/4
access.redhat.comaccess.redhat.com/errata/RHSA-2026:29182
access.redhat.comaccess.redhat.com/errata/RHSA-2026:29210
access.redhat.comaccess.redhat.com/errata/RHSA-2026:29867
access.redhat.comaccess.redhat.com/errata/RHSA-2026:29941
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30085
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30086
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30115
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30843
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30851
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30858
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30859
access.redhat.comaccess.redhat.com/errata/RHSA-2026:30860
access.redhat.comaccess.redhat.com/errata/RHSA-2026:50262
access.redhat.comaccess.redhat.com/security/cve/CVE-2026-48962
bugzilla.redhat.combugzilla.redhat.com/show_bug.cgi?id=2481767
security.access.redhat.comsecurity.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-48962.json

Frequently asked

questions

It can be, if a remote user can influence the output glob parameter—for example, via HTTP parameters, remote configuration, or other user inputs wired into IO::Compress. If the glob is derived only from local, trusted sources, the exposure is reduced.

An attacker needs the ability to supply or manipulate the value that IO::Compress::File::GlobMapper uses as the output glob. This might be indirect (through a config file or environment variable) or direct (through an application parameter).

The safest pattern is to eliminate eval STRING on any expression that includes user-controlled data. Treat glob patterns as plain data, use non-evaluating APIs for glob expansion, and ensure that any remaining dynamic behavior cannot be influenced by untrusted input.

Establish a rule that untrusted input is never passed to dynamic evaluation functions (such as eval STRING) or embedded into code expressions. Use explicit parsing or dedicated libraries for globs and other mini-languages, enforce strict input validation, and include checks for dangerous eval patterns in code review and automated tooling.

Find out what's already
exploitable in your codebase.