{"id":3325,"date":"2024-04-29T15:51:03","date_gmt":"2024-04-29T20:51:03","guid":{"rendered":"https:\/\/www.darkreading.com\/application-security\/r-programming-language-exposes-orgs-to-supply-chain-risk"},"modified":"2024-04-29T15:51:03","modified_gmt":"2024-04-29T20:51:03","slug":"r-programming-bug-exposes-orgs-to-vast-supply-chain-risk","status":"publish","type":"post","link":"https:\/\/ddi.mohflo.net\/index.php\/2024\/04\/29\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk\/","title":{"rendered":"R Programming Bug Exposes Orgs to Vast Supply Chain Risk"},"content":{"rendered":"<div class=\"media_block\"><a href=\"https:\/\/i0.wp.com\/eu-images.contentstack.com\/v3\/assets\/blt6d90778a997de1cd\/bltba499e3e3456af20\/6630001b0558d7f6f819b3aa\/rprogram_Billion_Photos_shutterstock.jpg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk.jpg?w=640&#038;ssl=1\" class=\"media_thumbnail\"><\/a><\/div>\n<div><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk.jpg?w=640&#038;ssl=1\" class=\"ff-og-image-inserted\"><\/div>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">A high-severity vulnerability in an R programming language process could expose organizations using the popular open source language to attacks via the software supply chain.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">The vulnerability, <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.incibe.es\/incibe-cert\/alerta-temprana\/vulnerabilidades\/cve-2024-27322\" rel=\"noopener\">assigned CVE-2024-27322<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">, has a CVSS vulnerability-severity score of 8.8 out of 10. It involves R&#8217;s process for deserializing data, or converting objects encoded in formats such as JSON, XML, and binary, back to their original form for use in an application or program.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">R is a relatively widely used <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.r-project.org\/about.html\" rel=\"noopener\">language for statistical computing<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> and graphics applications.&nbsp;It is popular among developers in sectors such as <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.codecademy.com\/resources\/blog\/what-is-r-used-for\/\" rel=\"noopener\">financial services, healthcare, research, government<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> and in environments involving large datasets such as AI and machine learning. The <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/cran.r-project.org\/\" rel=\"noopener\">Comprehensive R Archive Network<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> (CRAN), which is the most popular R package repository, currently hosts more than 20,000 packages, while <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/r-forge.r-project.org\/\" rel=\"noopener\">R-Forge<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">, a site that provides R package development tools, has more than 15,800 registered members and hosts some 2,146 projects.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"Deserialization Issue\">Deserialization Issue<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Researchers at HiddenLayer found a weakness in R&#8217;s process that gives attackers a way to execute arbitrary code in a victim environment via a specially crafted R Data Serialization (RDS) file. Programmers commonly use RDS files to store or save objects in R for future use or for sharing with others.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;This vulnerability can be exploited through the loading of RDS files or R packages, which are often shared between developers and data scientists,&#8221; HiddenLayer researchers Kasimir Schulz and&nbsp;Kieran Evans said in a <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/hiddenlayer.com\/research\/r-bitrary-code-execution\/\" rel=\"noopener\">report this week<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">. &#8220;An attacker can create malicious RDS files or R packages containing embedded arbitrary R code that executes on the victim\u2019s target device upon interaction,&#8221; according to the report.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">The maintainers of R have addressed the issue in <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/cran.r-project.org\/doc\/manuals\/r-release\/NEWS.html\" rel=\"noopener\">R version 4.4.0<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> after HiddenLayer informed them of the issue.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"A Lazy Promise Allows Tinkering\">A Lazy Promise Allows Tinkering<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">The vulnerability in R that HiddenLayer discovered relates to two fundamental concepts in R, called &#8220;lazy evaluation&#8221; and &#8220;promise objects.&#8221; <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.r-bloggers.com\/2018\/07\/about-lazy-evaluation\/#:~:text=Promise%20objects%20are%20part%20of,an%20expression%2C%20and%20an%20environment.\" rel=\"noopener\">Lazy evaluation<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> is a programming technique where an R program does not evaluate an expression or variable until actually required to, or when directly accessed. The goal is to improve performance by avoiding computations for expressions that might end up not being needed.&nbsp;A promise object is closely related to lazy evaluation and represents the object that has been delayed for evaluation.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">What the researchers at HiddenLayer discovered was a way to create a promise object with a payload that would run code of their choice when the object was accessed during RDS file deserialization.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;R packages leverage the RDS format to save and load data,&#8221; according to HiddenLayer. Two files that facilitate this process are an .rdb file that contains all the serialized objects to be included in a package, and an .rdx file that contains metadata about each of the objects.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;When a package is loaded, the metadata stored in the RDS format within the .rdx file is used to locate the objects within the .rdb file,&#8221; according to the analysis. The objects within the .rdb files are then deserialized.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;An attacker can exploit this by creating an RDS file that contains a specially crafted promise object embedded with arbitrary code,&#8221; Schulz tells Dark Reading. &#8220;Due to the way R implements lazy evaluation, the embedded arbitrary code will be executed once a user has loaded the malicious file or package.&#8221;&nbsp;An attacker can relatively easily add a weaponized package to an R repository such as CRAN and simply wait for an unwary user to load that package.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"Potentially Vast Attack Surface: Multiple Infection Sources\">Potentially Vast Attack Surface: Multiple Infection Sources<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">There are literally dozens of major hubs, such as R-Forget and <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.bioconductor.org\/about\/\" rel=\"noopener\">Bioconductor<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">, that R developers use to share and download packages. Not only are these hubs providing developers with access to thousands of packages, some, like Bioconductor, with more than 42 million downloads are being used regularly, Schulz says. &#8220;Someone just needs to take advantage of the vulnerability and the massive open source space for R packages to affect thousands of downstream users in a potentially massive supply chain attack,&#8221; he says.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Schulz recommends that organizations move to the latest version of R to mitigate risk: &#8220;In addition, organizations should ensure that users of R are made aware of current and potential future vulnerabilities of this nature and make it policy to only use known trusted files and packages.&#8221;<\/span><\/p>\n<p><a href=\"https:\/\/www.darkreading.com\/application-security\/r-programming-language-exposes-orgs-to-supply-chain-risk\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A high-severity vulnerability in an R programming language process could<\/p>\n","protected":false},"author":12,"featured_media":3326,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[809],"class_list":["post-3325","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-dark-reading"],"featured_image_urls":{"full":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=2560%2C1675&ssl=1",2560,1675,false],"thumbnail":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?resize=150%2C150&ssl=1",150,150,true],"medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=300%2C196&ssl=1",300,196,true],"medium_large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=640%2C419&ssl=1",640,419,true],"large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=640%2C419&ssl=1",640,419,true],"1536x1536":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=1536%2C1005&ssl=1",1536,1005,true],"2048x2048":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=2048%2C1340&ssl=1",2048,1340,true],"chromenews-featured":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=1024%2C670&ssl=1",1024,670,true],"chromenews-large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?resize=825%2C575&ssl=1",825,575,true],"chromenews-medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?resize=590%2C410&ssl=1",590,410,true]},"author_info":{"display_name":"Dark Reading","author_link":"https:\/\/ddi.mohflo.net\/index.php\/author\/darkreading\/"},"category_info":"<a href=\"https:\/\/ddi.mohflo.net\/index.php\/category\/uncategorized\/\" rel=\"category tag\">Uncategorized<\/a>","tag_info":"Uncategorized","comment_count":"0","jetpack_featured_media_url":"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/04\/r-programming-bug-exposes-orgs-to-vast-supply-chain-risk-scaled.jpg?fit=2560%2C1675&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/3325","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/comments?post=3325"}],"version-history":[{"count":0,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/3325\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media\/3326"}],"wp:attachment":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media?parent=3325"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/categories?post=3325"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/tags?post=3325"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}