A serious security vulnerability identified in the R programming language has been exposed, potentially allowing attackers to execute arbitrary code through manipulated RDS files. Known under the CVE identifier CVE-2024-27322 and rated with a high CVSS score of 8.8, this flaw manipulates promise objects and lazy evaluation methods integral to R’s functionality. Security analysts at HiddenLayer uncovered this risk, which could facilitate attackers in compromising data through the R language widely used for statistical computing, data visualization, and machine learning.
The specific mechanism of attack involves the serialization and deserialization processes utilized in R, similar to those found in Python’s pickle format. These processes, essential for storing and retrieving R objects and data structures, can be hijacked by supplying crafted RDS files that trigger code execution upon their loading. This vulnerability not only affects individual users but also opens up avenues for widespread supply chain attacks by compromising R packages stored in repositories like CRAN.
To execute an attack, an assailant would need to replace the .rdx file in an R package with a malicious file. When this tampered package is subsequently loaded by an unsuspecting user, the embedded code executes automatically due to the package’s use of lazy evaluation. Researchers Kasimir Schulz and Kieran Evans emphasize the simplicity of this attack vector, highlighting its potential for broad impact across the R user community.
Prompted by these findings, the developers of R addressed this vulnerability in the newly released version 4.4.0 as of April 24, 2024. Additionally, the CERT Coordination Center issued an advisory urging users to avoid processing untrusted RDS files and to upgrade their software to mitigate the risks associated with this significant security flaw. Users and administrators are encouraged to apply these updates swiftly to safeguard their systems against potential exploits.