CVE-2023-47039: Perl: perl for windows binary hijacking vulnerability
A vulnerability was found in Perl. This security issue occurs while Perl for Windows relies on the system path environment variable to find the shell (cmd.exe). When running an executable that uses the Windows Perl interpreter, Perl attempts to find and execute cmd.exe within the operating system. However, due to path search order issues, Perl initially looks for cmd.exe in the current working directory. This flaw allows an attacker with limited privileges to placecmd.exe in locations with weak permissions, such as C:\ProgramData. By doing so, arbitrary code can be executed when an administrator attempts to use this executable from these compromised locations.
Other sources
Perl for Windows relies on the system path environment variable to find the shell (cmd.exe). When running an executable which uses Windows Perl interpreter, Perl attempts to find and execute cmd.exe within the operating system. However, due to path search order issues, Perl initially looks for cmd.exe in the current working directory.
An attacker with limited privileges can exploit this behavior by placing cmd.exe in locations with weak permissions, such as C:\ProgramData. By doing so, when an administrator attempts to use this executable from these compromised locations, arbitrary code can be executed.
— Red Hat
Affected Software
Remediation
Patch Available
Event History
Frequently Asked Questions
What is the severity of CVE-2023-47039?
CVE-2023-47039 is considered a moderate severity vulnerability due to its reliance on the system path environment variable in Perl.
How do I fix CVE-2023-47039?
To fix CVE-2023-47039, upgrade your Perl installation to 5.32.1 or higher on Red Hat or to the recommended versions on Debian.
Which versions of Perl are affected by CVE-2023-47039?
CVE-2023-47039 affects Perl versions up to but not including 5.32.1 on Red Hat and specific versions on Debian 5.32.1-4+deb11u3, 5.32.1-4+deb11u4, 5.36.0-7+deb12u1, and 5.40.0-8.
On which operating system does CVE-2023-47039 occur?
CVE-2023-47039 occurs on the Windows operating system when using the Perl interpreter.
What impact does CVE-2023-47039 have on system security?
CVE-2023-47039 may lead to untrusted command execution if an executable relies on the vulnerable Perl interpreter's handling of environment paths.