{"id":13423,"date":"2026-06-06T10:03:41","date_gmt":"2026-06-06T10:03:41","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2026\/06\/06\/critical-hugging-face-transformers-vulnerability-enables-remote-code-execution-attacks\/"},"modified":"2026-06-06T10:03:41","modified_gmt":"2026-06-06T10:03:41","slug":"critical-hugging-face-transformers-vulnerability-enables-remote-code-execution-attacks","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2026\/06\/06\/critical-hugging-face-transformers-vulnerability-enables-remote-code-execution-attacks\/","title":{"rendered":"Critical Hugging Face Transformers Vulnerability Enables Remote Code Execution Attacks"},"content":{"rendered":"<p>    Critical Hugging Face Transformers Vulnerability Enables Remote Code Execution Attacks<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p class=\"wp-block-paragraph\">A newly disclosed critical <a href=\"https:\/\/cybersecuritynews.com\/attackers-spread-blockchain-based-backdoor-via-hugging-face\/\" target=\"_blank\" rel=\"noreferrer noopener\">vulnerability in the HuggingFace<\/a> Transformers library, tracked as CVE-2026-4372, allows attackers to achieve remote code execution (RCE) through malicious model configuration files.<\/p>\n<p class=\"wp-block-paragraph\">The flaw exposes a significant supply chain risk in one of the most widely used machine learning frameworks, impacting developers, enterprises, and AI pipelines globally.<\/p>\n<p class=\"wp-block-paragraph\">The vulnerability stems from improper handling of untrusted data in model configuration files, specifically in the _attn_implementation_internal attribute.<\/p>\n<p class=\"wp-block-paragraph\">Attackers can inject this field into a model\u2019s config.json, causing the library to load and <a href=\"https:\/\/cybersecuritynews.com\/python-ply-library-vulnerability\/\" target=\"_blank\" rel=\"noreferrer noopener\">execute arbitrary Python code<\/a> during the standard model loading process.<\/p>\n<p class=\"wp-block-paragraph\">This occurs even when the security control trust_remote_code=False is enforced, effectively bypassing a key protection mechanism.<\/p>\n<h2 id=\"h-huggingface-flaw-enables-rce\" class=\"wp-block-heading\"><strong>HuggingFace Flaw Enables RCE<\/strong><\/h2>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj0bM33XJcpsHlMdZUcPbD5EL-XvKCH4udBTc9QgNooavFozoBhEwwuJfCAl0SOtUW2rQ-YHy66QAvg60vJNUlM38xYJnpfgkuJNLwDAEmVlk-2vzcaumHsIQfI9HuYy4NUSWy63An6400evMnmehxlYnRBlqwv5ZTCKDodISw_J3ULLKI09rRsauMm6WA\/s1600\/Screenshot%25202026-06-05%2520134722%2520%25281%2529.webp?ssl=1\" alt=\"The Kill Chain (source : pluto)\"><figcaption class=\"wp-element-caption\">The Kill Chain (Source: Pluto)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">The issue affects Transformers versions 4.56.0 through 5.2.x when used with the optional kernels package.<\/p>\n<p class=\"wp-block-paragraph\">The vulnerable code path was introduced in August 2025. It remained exploitable until March 2026, creating an exposure window of approximately six months.<\/p>\n<p class=\"wp-block-paragraph\">During this period, any user loading a <a href=\"https:\/\/cybersecuritynews.com\/microsoftsystem64-malware-uses-huggingface-datasets\/\" target=\"_blank\" rel=\"noreferrer noopener\">malicious model from HuggingFace Hub<\/a> using the common from_pretrained() function could be silently compromised.<\/p>\n<p class=\"wp-block-paragraph\">In a typical attack scenario, a threat actor uploads a seemingly legitimate model to HuggingFace Hub. The model includes a crafted config.json file that contains the malicious _attn_implementation_internal field, which points to an attacker-controlled repository.<\/p>\n<p class=\"wp-block-paragraph\">When a victim loads the model, the Transformers library automatically downloads and imports the referenced code without validation or sandboxing. This leads to immediate code execution on the victim\u2019s system.<\/p>\n<p class=\"wp-block-paragraph\">Successful exploitation enables attackers to access sensitive data, including <a href=\"https:\/\/cybersecuritynews.com\/amazon-eks-vulnerabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">AWS credentials<\/a>, SSH keys, API tokens, and environment variables.<\/p>\n<p class=\"wp-block-paragraph\">It also enables persistence mechanisms, lateral movement across infrastructure, and potential compromise of CI\/CD pipelines.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjCS68JHB6FTjO7KWKIQaUJ8B68Im7a80d7RSE71h9oKuChzx4j0NsEnRqTinsMy0jR_ZaXX4p7rri9ttiItsZnYwISW1aZNPabI-Tzx0xb-zeBmnKVhN6brgExpD_pMRm_mhxlsSPx6ZaNQCZEthC-9Y-pdVp_oEtYzZSFHHTSEfK7IPVFlqMjtdYQpio\/s1600\/Screenshot%25202026-06-05%2520134851%2520%25282%2529.webp?ssl=1\" alt=\"Scale of Exposure (source :pluto)\"><figcaption class=\"wp-element-caption\">Scale of Exposure (source:Pluto)<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">Because the attack executes during normal model loading, it produces no warnings or visible indicators, making detection extremely difficult.<\/p>\n<p class=\"wp-block-paragraph\">The scale of impact is substantial. The Transformers library has over 2.2 billion installs and processes approximately 146 million downloads per month.<\/p>\n<p class=\"wp-block-paragraph\">With more than one million models hosted on HuggingFace Hub, the attack surface is extensive. During the exposure period, an estimated 232 million installations were vulnerable, increasing the likelihood of real-world exploitation.<\/p>\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pluto.security\/blog\/unauthenticated-remote-code-execution-in-huggingface-transformers-via-config-injection\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Researchers at Pluto Security noted that the vulnerability<\/a> highlights a broader issue in machine learning ecosystems: treating model files and configurations as trusted inputs.<\/p>\n<p>Similar patterns have been observed in other frameworks, where \u201csafe\u201d modes fail to prevent code execution because internal pathways are not fully accounted for.<\/p>\n<p class=\"wp-block-paragraph\">HuggingFace addressed the issue in version 5.3.0 by blocking unsafe internal attributes during configuration parsing and enforcing stricter controls on kernel loading.<\/p>\n<p class=\"wp-block-paragraph\">The fix also ensures that external code execution requires explicit user consent via trust_remote_code=True. Organizations using Transformers are strongly advised to upgrade to version 5.3.0 or later immediately.<\/p>\n<p class=\"wp-block-paragraph\">Additionally, teams should audit previously downloaded models, monitor for suspicious outbound connections, and isolate model execution environments to reduce risk.<\/p>\n<p class=\"wp-block-paragraph\">CVE-2026-4372 underscores the growing importance of securing AI supply chains. As machine learning adoption accelerates, attackers are increasingly targeting model distribution platforms, turning trusted workflows into high-impact attack vectors.<\/p>\n<p class=\"has-text-align-center has-background wp-block-paragraph\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 91%,rgb(169,184,195) 100%)\"><strong>Follow us on\u00a0<a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener\">Google News<\/a>,\u00a0<a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener\">LinkedIn<\/a>,\u00a0and\u00a0<a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener\">X<\/a>\u00a0to Get More Instant Updates.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/hugging-face-rce-vulnerability\/\">Critical Hugging Face Transformers Vulnerability Enables Remote Code Execution Attacks<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Abinaya<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/hugging-face-rce-vulnerability\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Critical Hugging Face Transformers Vulnerability Enables Remote Code Execution Attacks A newly disclosed critical vulnerability in the HuggingFace Transformers library, tracked as CVE-2026-4372, allows attackers to achieve remote code execution (RCE) through malicious model configuration files. The flaw exposes a significant supply chain risk in one of the most widely used machine learning frameworks, impacting [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,131,648],"tags":[130],"class_list":["post-13423","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13423"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=13423"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/13423\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=13423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=13423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=13423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}