CVE-2026-120359 in FindBin::libsinfo

Summary

by MITRE • 11/30/2026

FindBin::libs versions from 4.1.0 before 5.4.0 for Perl add the current directory to LD_LIBRARY_PATH with the ld_lib option.

When LD_LIBRARY_PATH is unset, ld_lib sets it to the directories found followed by a trailing colon. The dynamic linker reads the empty element after it as the current directory. The option exists only in the module installed on Perl 5.40 and later.

A local attacker who can write to the working directory of a program the script runs can plant a shared library that runs as the script's user.

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Analysis

by VulDB Data Team • 11/30/2026

The vulnerability identified in FindBin::libs versions ranging from 4.1.0 up to, but not including, version 5.4.0 for Perl represents a significant security flaw related to dynamic linker path manipulation and insecure directory handling. This issue specifically affects the ld_lib option within the module, which is designed to manage library paths during script execution. The core technical failure lies in how the module constructs the LD_LIBRARY_PATH environment variable when it is initially unset or empty. Instead of providing a clean list of directories, the implementation appends the found directories followed by a trailing colon character. This syntactic error results in an empty element being present at the end of the path string.

In Unix-like operating systems, the dynamic linker interprets an empty element within the LD_LIBRARY_PATH variable as a directive to search the current working directory for shared libraries. Consequently, when FindBin::libs sets this environment variable with its trailing colon artifact, it inadvertently instructs the system loader to prioritize the script's execution context over standard secure library locations. This behavior creates a classic insecure default configuration where the application becomes susceptible to loading maliciously crafted binaries from directories that are writable by untrusted users or processes. The vulnerability is particularly notable because this specific option and its associated logic were introduced in Perl 5.40 and later, meaning systems running these newer versions of Perl with affected module releases are directly exposed to this risk vector while older installations remain unaffected due to the absence of the vulnerable code path.

From an operational impact perspective, this vulnerability enables a local privilege escalation or arbitrary code execution scenario for any attacker who possesses write access to the working directory where the Perl script is executed. If such an attacker can place a malicious shared library file with a name that matches one expected by the application into that directory, the dynamic linker will load it instead of the legitimate system library due to the precedence granted by the LD_LIBRARY_PATH modification. The malicious code then executes within the security context and privileges of the user running the Perl script. This can lead to data theft, unauthorized access to sensitive resources, or further compromise of the host system depending on the permissions held by the executing process.

This flaw aligns with CWE-427, which describes Uncontrolled Search Path Element, as it involves a software product that does not properly control search paths for external components, allowing an attacker to influence the execution environment. Furthermore, in terms of offensive security frameworks such as MITRE ATT&CK, this vulnerability facilitates techniques related to Library Hijacking and Dynamic Linker Injection. Attackers can leverage these methods to execute arbitrary code without needing direct write access to system directories or elevated privileges initially, relying instead on local file creation capabilities within the application's working directory.

Mitigation strategies for this vulnerability primarily involve upgrading the FindBin::libs module to version 5.4.0 or later, where the developers have addressed the trailing colon issue and corrected the path construction logic. In environments where immediate patching is not feasible, administrators should ensure that LD_LIBRARY_PATH is explicitly set by system-level configurations rather than relying on application defaults, thereby overriding any insecure values injected by the script. Additionally, restricting write permissions to the working directories of critical Perl applications can prevent attackers from planting malicious libraries. It is also advisable to audit scripts for other instances where environment variables are manipulated dynamically and ensure that such manipulations do not introduce empty path elements or reference untrusted directories. Regular security audits focusing on dynamic linking behaviors in interpreted languages like Perl will help identify similar misconfigurations before they can be exploited by local attackers seeking to escalate privileges or compromise system integrity.

Responsible

CPANSec

Reservation

11/01/2026

Disclosure

11/30/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you need the next level of professionalism?

Upgrade your account now!