Perl FindBin modules before 5.4.0 have two local code flaws
FindBin::libs can add the current directory to LD_LIBRARY_PATH; FindBin::Bin can eval the script directory name.
Current-directory library load via FindBin::libs ld_lib
FindBin::libs 4.1.0 before 5.4.0, on Perl 5.40 and later, can add the current directory to LD_LIBRARY_PATH when the ld_lib option is used. If that variable is unset, a trailing colon makes the dynamic linker treat the working directory as a library path. A local attacker who can write there can plant a shared library that runs as the script's user.
What to do: Upgrade FindBin::libs to 5.4.0.
| Product | Affected | Fixed in |
|---|---|---|
| FindBin::libs | 4.1.0 before 5.4.0 (ld_lib only on Perl 5.40 and later) | 5.4.0 |
Order-of-magnitude estimate by the model from install counts, market share and public scan data it knows; verify before quoting.
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.
FindBin::libs can add the current directory to LD_LIBRARY_PATH; FindBin::Bin can eval the script directory name.
Today 2.5K readers · 5K views · 287 reads · all time 290K views