{"id":8589,"date":"2025-11-20T10:05:08","date_gmt":"2025-11-20T10:05:08","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/11\/20\/ollama-vulnerabilities-let-attackers-execute-arbitrary-code-by-parsing-of-malicious-model-files\/"},"modified":"2025-11-20T10:05:08","modified_gmt":"2025-11-20T10:05:08","slug":"ollama-vulnerabilities-let-attackers-execute-arbitrary-code-by-parsing-of-malicious-model-files","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/11\/20\/ollama-vulnerabilities-let-attackers-execute-arbitrary-code-by-parsing-of-malicious-model-files\/","title":{"rendered":"Ollama Vulnerabilities Let Attackers Execute Arbitrary Code by Parsing of Malicious Model Files"},"content":{"rendered":"<p>    Ollama Vulnerabilities Let Attackers Execute Arbitrary Code by Parsing of Malicious Model Files<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>A severe vulnerability in Ollama, one of GitHub\u2019s most popular open-source projects, with over 155,000 stars. The flaw enables attackers to execute arbitrary code on systems running vulnerable versions of the platform by exploiting weaknesses in the software\u2019s parsing of model files.<\/p>\n<p>Ollama is a widely used tool that allows developers and AI specialists to run large language models locally without relying on external services like <a href=\"https:\/\/cybersecuritynews.com\/chatgpt-atlas-browser-jailbroken\/\" target=\"_blank\" rel=\"noreferrer noopener\">OpenAI<\/a>.<\/p>\n<p>The platform supports numerous open-source models, including gpt-oss, <a href=\"https:\/\/cybersecuritynews.com\/deepseek-r1-prompts-exploited\/\" target=\"_blank\" rel=\"noreferrer noopener\">DeepSeek-R1<\/a>, Meta\u2019s Llama4, and Google\u2019s Gemma3.<\/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\/AVvXsEiHSjWOx5wshvsQRjJ9-qwJ-wqjgYiZSu5wHGcJoc3MZHkXqOElb-xIRp_TV1UnFCOlp0v2PEtyv70M5VuG1msoxnTILro6nB-XntmRyGMmtYVrrP9JVmankfp3qRig2b_hbJfrXTCA5wxlpC8NhOLkOtzpcMt-z1_of_nc-Lk1NiXravn7SaLAMchOrJQ\/s1600\/Screenshot%25202025-11-20%2520110621%2520%25281%2529.webp?ssl=1\" alt=\"lient-server architecture of Ollama\"><figcaption class=\"wp-element-caption\">client-server architecture of Ollama<\/figcaption><\/figure>\n<p>Sonarsource researchers found a critical <a href=\"https:\/\/cybersecuritynews.com\/out-of-bounds-read-and-write\/\" target=\"_blank\" rel=\"noreferrer noopener\">Out-Of-Bounds Write<\/a> vulnerability during security auditing of Ollama\u2019s codebase.<\/p>\n<p>The vulnerability affects all Ollama versions before 0.7.0 and exists in the model file parsing mechanism. When processing specially crafted GGUF model files, the software fails to validate specific metadata values properly.<\/p>\n<p>Specifically, during the parsing of mllama models, the code does not verify whether indices specified in the model\u2019s metadata fall within acceptable bounds. This oversight allows attackers to manipulate memory beyond allocated boundaries.<\/p>\n<p>The exploitation path involves creating malicious model files with oversized metadata entries or invalid layer indices. When Ollama processes these files, the vulnerability triggers an Out-Of-Bounds Write condition.<\/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\/AVvXsEgJXHgsGFDtvgkF8VXICD66CGnR1lyuXj2P-nRuEaHg6TUCLdou7NgkQYhnCRDmXJxtS-qmbSONXqV6NTvrnybP-zZmmCuw2s9kEIPeGsvPd90WmX9ZGgNgTi5REE7RgsCUrMQSeg65c1GtZfukV5q3DG4tu3pvAda6sSLIme1HZppnUenz59VZJLUllT0\/s1600\/Screenshot%25202025-11-20%2520111004%2520%25281%2529.webp?ssl=1\" alt=\"model file to confirm OOB write\"><figcaption class=\"wp-element-caption\">model file to confirm OOB write<\/figcaption><\/figure>\n<p>Attackers who gain access to Ollama\u2019s API can load and execute these weaponized models, achieving remote code execution on the target system.<\/p>\n<p>Sonarsource confirmed the vulnerability is exploitable in builds without Position Independent Executable configuration,<a href=\"https:\/\/www.sonarsource.com\/blog\/ollama-remote-code-execution-securing-the-code-that-runs-llms\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\"> releases<\/a> include this protection; experts believe exploitation remains feasible with additional effort.<\/p>\n<p>The vulnerability particularly affects the mllama model parsing code written in C++, where unsafe memory operations occur during model initialization.<\/p>\n<p>The <a href=\"https:\/\/cybersecuritynews.com\/1100-ollama-ai-servers-exposed\/\" target=\"_blank\" rel=\"noreferrer noopener\">Ollama<\/a> development team addressed this vulnerability in version 0.7.0 by completely rewriting the vulnerable mllama model handling code in Go, eliminating the unsafe C++ implementation.<\/p>\n<p>Users running older versions face significant security risks and should upgrade to the latest release immediately.<\/p>\n<p>Organizations using Ollama in production environments should audit their deployments and implement version controls to prevent the loading of untrusted model files.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 94%,rgb(169,184,195) 100%)\"><strong>Follow us on <a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google News<\/a>, <a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LinkedIn<\/a>, and <a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">X<\/a> for daily cybersecurity updates. <a href=\"https:\/\/cybersecuritynews.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Contact us<\/a> to feature your stories.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/ollama-vulnerabilities-code-execution\/\">Ollama Vulnerabilities Let Attackers Execute Arbitrary Code by Parsing of Malicious Model Files<\/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\/ollama-vulnerabilities-code-execution\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ollama Vulnerabilities Let Attackers Execute Arbitrary Code by Parsing of Malicious Model Files A severe vulnerability in Ollama, one of GitHub\u2019s most popular open-source projects, with over 155,000 stars. The flaw enables attackers to execute arbitrary code on systems running vulnerable versions of the platform by exploiting weaknesses in the software\u2019s parsing of model files. [&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,648],"tags":[130],"class_list":["post-8589","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8589"}],"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=8589"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8589\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=8589"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=8589"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=8589"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}