External risk intelligence

FindBin Perl Module Code Execution via Directory Name Eval

CVE advisorySeverity: CRITICAL (CVSS 9.8)

CVE-2026-120361

This vulnerability exists in a Perl module used within local scripts. Exploitation requires an attacker to control the naming of a directory where a script resides and to convince a local user or automated process to execute that script from within that directory. It is not a network-facing service, API, or internet-accessible application component.

Halo Surface Signal: 1 out of 5 — much less likely to be public-facing.

External exposure likelihood

Horizon Alert

Summary of the vulnerability and why it matters

A vulnerability exists in a Perl module that could allow an attacker to execute code if they can control the name of a directory where a script is run. This occurs when the module interpolates a script's directory name into a string eval without proper escaping, allowing a single quote in the directory name to break out of the string and execute code. While impactful, exploitation requires specific conditions related to directory naming and script execution within that directory.

  • Directory names can run malicious code.
  • Potential for code execution on affected systems.
  • Confirm relevance and exposure of the module.

Attack Path

How an attacker could exploit the issue

An attacker could execute arbitrary code by creating a specially named directory and then tricking a user or process into running a Perl script from within that directory. This works because the FindBin::Bin module in Perl, when processing the script's location, does not properly sanitize directory names. If a directory name contains a single quote, it breaks out of the intended code string, allowing the attacker's crafted code within the directory name to be executed by Perl.

  • Attacker names a directory.
  • Script execution from that directory.
  • Arbitrary code execution.

Live Threat

Current exploitation, exposure, and threat context

When supported by the advisory, an attacker could execute arbitrary Perl code by controlling the name of a directory where a script is run. This could happen if a script uses the FindBin::Bin module to interpolate its directory name into an `eval` statement without proper escaping.

  • Directory names and script execution.
  • User executes script in crafted directory.
  • Arbitrary code execution.

Operational Fix

Recommended remediation, mitigation, and detection steps

Ownership of this vulnerability lies with teams managing Perl applications and their runtime environments, including infrastructure, platform, or development teams. The immediate practical step is to inventory all systems running Perl scripts that use the FindBin module, confirm their reachability and criticality, and identify the accountable application or system owner before planning remediation.

  • Application owners should own remediation.
  • Verify Perl script usage of FindBin.
  • Plan risk-based remediation actions.

Supplementary metadata

Validate whether this threat affects your internet-facing exposure.

Halo Threat Intelligence helps prioritize remediation with Halo Surface Signal and H/A/L/O context. Start exposure validation with a free external attack surface trial.

Frequently asked questions

What is the FindBin::Bin module in Perl?

FindBin::Bin is a utility component included with Perl 5.40 and later. Developers use it within Perl scripts to automatically locate the directory where the script itself is stored, which is helpful for finding related configuration files or libraries relative to the script's own path.

How does CVE-2026-120361 trigger code execution?

This vulnerability is a Code Injection flaw, specifically categorized as CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code). The module fails to sanitize directory names before inserting them into an eval string. By including a single quote in a folder name, an attacker can prematurely close the string and force Perl to interpret the remaining part of the directory path as executable code.

Do I need to worry if my directory names are standard?

No. The vulnerability requires a specific, malicious directory name containing a single quote character. Furthermore, the bug is not triggered simply by the existence of such a folder; it only activates when a Perl script using the vulnerable FindBin::Bin logic is actually executed from within that specifically named directory.

Is this CVE likely to be reached over the network?

According to Halo Surface Signal, this is very unlikely. The vulnerability resides in local Perl modules rather than network-facing services or APIs. It typically requires an attacker to manipulate the file system or environment where scripts are run, making it an unlikely target for remote, unauthenticated network-based exploitation.

What should I do if I use Perl scripts?

First, conduct an inventory to determine if any of your Perl applications utilize the FindBin module, specifically versions 4.0.1 through 5.3.x. Once identified, consult your application development or platform teams to prioritize updates or code changes, as they are responsible for managing these local runtime dependencies.

References