CVE-2026-120359: 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
FindBin::libs versions from 4.1.0 before 5.4.0 for Perl add the current directory to LDLIBRARYPATH with the ldlib option.
When LDLIBRARYPATH is unset, ldlib 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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
FindBin::libsto a version that resolves this vulnerability.Fixed in 5.4.0
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments using FindBin::libs from 4.1.0 before 5.4.0 are exposed only when running on Perl 5.40 or later and using the ld_lib option. The issue occurs when LD_LIBRARY_PATH is initially unset.
What does an attacker need to exploit this?
An attacker needs the ability to write to the working directory of a program that runs the affected script. They can plant a shared library there, which may be loaded and executed as the user running the script.
Is the default configuration affected?
The vulnerable behavior requires use of the ld_lib option; the option exists only in the module installed on Perl 5.40 and later. The provided information does not establish that ld_lib is enabled by default.
What can be done if upgrading is not immediately possible?
Avoid using the ld_lib option in affected scripts, or ensure LD_LIBRARY_PATH is set without a trailing empty path element before the script runs. Restrict untrusted users from writing to the program's working directory.