A significant security vulnerability in the WPML (WordPress Multilingual) plugin has put over 1 million WordPress sites at risk of remote code execution (RCE) attacks. The flaw, designated as CVE-2024-6386, impacts all versions of the plugin up to and including 4.6.12. This vulnerability allows authenticated users with contributor-level access or higher to execute arbitrary code on the server, potentially leading to a complete site takeover. The issue was first identified by a security researcher known as “stealth copter,” who reported the flaw through the Wordfence Bug Bounty Program and received a $1,639 reward for this critical discovery.
The vulnerability stems from a lack of input validation and sanitization in the WPML plugin’s use of the Twig templating engine. Specifically, the flaw is found in the render() function of the WPML_LS_Public_API class, which processes user-supplied Twig templates without proper sanitization. This oversight enables attackers to perform server-side template injection, allowing them to inject and execute malicious PHP code. A proof-of-concept exploit demonstrates the risk by using the [wpml_language_switcher] shortcode to inject Twig code that can execute PHP functions like phpinfo(), revealing sensitive server information.
In response to the vulnerability, Wordfence released a firewall rule on June 27, 2024, to protect its premium users. Protection for free users was added a month later. Despite these measures, the WPML development team faced communication challenges but eventually released a patch on August 20, 2024, with version 4.6.13 addressing the vulnerability. Users are strongly advised to update to the latest version of WPML to mitigate the risk posed by this critical flaw, which has a CVSS score of 9.9, emphasizing the urgency of the update.
This incident highlights the ongoing need for vigilance and robust security practices within the WordPress ecosystem. As plugins become more complex, vulnerabilities such as this one remind users of the potential risks associated with third-party integrations. To protect their sites, users should remain proactive in applying updates and enhancing their security measures.
Reference: