A critical vulnerability has been discovered in WinRAR, a popular file compression and archiving utility for Windows. Tracked as CVE-2024-36052, the flaw affects WinRAR versions prior to 7.00, allowing attackers to spoof the screen output using ANSI escape sequences. This vulnerability arises from WinRAR’s failure to properly validate and sanitize file names within ZIP archives.
When a specially crafted ZIP archive containing a file with ANSI escape sequences in its name is extracted using WinRAR, the application interprets them as control characters instead of handling them properly. Attackers can exploit this behavior to manipulate the displayed file name and potentially trick users into running malicious files. ANSI escape sequences are special codes used to control the formatting and appearance of text in command-line interfaces and terminals.
By crafting malicious archives containing these sequences, attackers can deceive users into believing they are opening harmless files like PDFs or images. However, upon attempting to open the file, WinRAR’s ShellExecute function may execute a hidden malicious script instead of the expected document, leading to the installation of malware on the victim’s device. This vulnerability poses a significant risk to WinRAR users on Windows systems and underscores the importance of updating to WinRAR version 7.00 or later to mitigate the risk.
Furthermore, users are advised to exercise caution when opening archives from untrusted sources and to enable file extension visibility in Windows to prevent such attacks. The vulnerability, publicly disclosed on May 23, 2024, highlights the need for immediate action to protect WinRAR users’ systems from potential exploitation by malicious actors.