{"id":865,"date":"2026-05-10T13:05:19","date_gmt":"2026-05-10T13:05:19","guid":{"rendered":"https:\/\/thedigitalfortress.us\/?p=865"},"modified":"2026-05-10T13:05:19","modified_gmt":"2026-05-10T13:05:19","slug":"ollama-out-of-bounds-read-vulnerability-allows-remote-process-memory-leak","status":"publish","type":"post","link":"https:\/\/thedigitalfortress.us\/?p=865","title":{"rendered":"Ollama Out-of-Bounds Read Vulnerability Allows Remote Process Memory Leak"},"content":{"rendered":"<div id=\"articlebody\">\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEj92eUjjTTMJPizvUJGwq7Ych7nrXHwGRNt3hS9yjNGRJk5d3pdIKjeZhQDVuFp0DnKjP4qoieGWFjswm7nHDLBaxWC3DxFIfLfRjMSEXd0Ta04vcTrbCpS9PEXebUUbMBxBt0VOb-PKVk-7Cq0FjuMXl4VtKneb5a3ujCo872goPN22GBFFhReJtWsQJLK\/s1700-e365\/oll.jpg\" style=\"clear: left; display: block; float: left;  text-align: center;\"><\/a><\/div>\n<p>Cybersecurity researchers have disclosed a critical security vulnerability in Ollama that, if successfully exploited, could allow a remote, unauthenticated attacker to leak its entire process memory.<\/p>\n<p>The out-of-bounds read flaw, which likely impacts over 300,000 servers globally, is tracked as <strong>CVE-2026-7482<\/strong> (CVSS score: 9.1). It has been <a href=\"https:\/\/www.cyera.com\/research\/bleeding-llama-critical-unauthenticated-memory-leak-in-ollama\">codenamed<\/a>\u00a0<strong>Bleeding Llama<\/strong> by Cyera.<\/p>\n<p><a href=\"https:\/\/github.com\/ollama\/ollama\">Ollama<\/a> is a popular open-source framework that allows large language models (LLMs) to be run locally instead of on the cloud. On GitHub, the project has more than 171,000 stars and has been forked over 16,100 times.<\/p>\n<p>\u00abOllama before <a href=\"https:\/\/github.com\/ollama\/ollama\/releases\/tag\/v0.17.1\">0.17.1<\/a> contains a heap out-of-bounds read vulnerability in the GGUF model loader,\u00bb according to a <a href=\"https:\/\/www.cve.org\/CVERecord?id=CVE-2026-7482\">description<\/a> of the flaw in CVE.org. \u00abThe \/api\/create endpoint accepts an attacker-supplied GGUF file in which the declared tensor offset and size exceed the file&#8217;s actual length; during quantization in fs\/ggml\/gguf.go and server\/quantization.go (WriteTo()), the server reads past the allocated heap buffer.\u00bb<\/p>\n<p>GGUF, short for GPT-Generated Unified Format, is a file format that&#8217;s used to store large language models so that they can be easily loaded and executed locally.<\/p>\n<p>The problem, at its core, stems from Ollama&#8217;s use of the <a href=\"https:\/\/pkg.go.dev\/unsafe\">unsafe package<\/a> when creating a model from a GGUF file, specifically in a function named \u00abWriteTo(),\u00bb thereby making it possible to execute operations that bypass the memory safety guarantees of the programming language.<\/p>\n<p>In a hypothetical attack scenario, a bad actor can send a specially crafted GGUF file to an exposed Ollama server with the <a href=\"https:\/\/www.tensorflow.org\/guide\/tensor\">tensor&#8217;s shape<\/a> set to a very large number to trigger the out-of-bounds heap read during model creation using the \/api\/create endpoint. Successful exploitation of the vulnerability could leak sensitive data from the Ollama process memory.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/threatlabz-vpn-risk-2026-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhnNON5UeWywT7OcPNw7V4L7QNWnCnm7Xl_99Y9ek8dL-gRwx-bWxQM1TKqt8deqqrdpUyKMuuijAWyyPQVB0s0qf8ntQ6ldFAJLru-QUWhddKTopc7SeNbBBnd-TsfFyRPP-AAyDuclLlL6XHK4_LXqDC_7eyaz9pzToYr7U543MhrJ7qcK-89sVWHTQUZ\/s728-e100\/zz-2-d.jpg\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>This may include environment variables, API keys, system prompts, and concurrent users&#8217; conversation data. This data can be exfiltrated by uploading the resulting model artifact through the \/api\/push endpoint to an attacker-controlled registry.<\/p>\n<p>The <a href=\"https:\/\/www.cyera.com\/blog\/bleeding-llama-a-critical-memory-leak-in-the-worlds-most-popular-local-ai-platform\">exploitation chain<\/a> unfolds over three steps &#8211;<\/p>\n<p><a name=\"more\"\/><\/p>\n<ul>\n<li>Upload a crafted GGUF file with an inflated tensor shape to a network-accessible Ollama server using an HTTP POST request.<\/li>\n<li>Use the \/api\/create endpoint to activate model creation, firing the out-of-bounds read vulnerability.<\/li>\n<li>Use the \/api\/push endpoint to exfiltrate data from the heap memory to an external server.<\/li>\n<\/ul>\n<p>\u00abAn attacker can learn basically anything about the organization from your AI inference \u2014 API keys, proprietary code, customer contracts, and much more,\u00bb Cyera security researcher Dor Attias said.<\/p>\n<div class=\"separator\" style=\"clear: both;\"><a href=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgwC3ssbxShiYtGxS0JsLsXPZNi7Atqo7Kp7Le1nJRDTA8F69oR9CRuvm0jFe7LpKoj8_w1nZCRjfcXhcZVbfBwl98PNt_xUeAJvZWUlKm-3fxB6AgcvNLZ9C1qEyzvg9bXwbW7lTrFjlnfWkOmUEARlwwPhO231DqSRA2r4QrKud_BpmEk6IhO5ZvoT1FJ\/s1700-e365\/api.png\" style=\"clear: left; display: block; float: left;  text-align: center;\"><img decoding=\"async\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgwC3ssbxShiYtGxS0JsLsXPZNi7Atqo7Kp7Le1nJRDTA8F69oR9CRuvm0jFe7LpKoj8_w1nZCRjfcXhcZVbfBwl98PNt_xUeAJvZWUlKm-3fxB6AgcvNLZ9C1qEyzvg9bXwbW7lTrFjlnfWkOmUEARlwwPhO231DqSRA2r4QrKud_BpmEk6IhO5ZvoT1FJ\/s1700-e365\/api.png\" alt=\"\" border=\"0\" data-original-height=\"955\" data-original-width=\"2000\"\/><\/a><\/div>\n<p>\u00abOn top of that, engineers often connect Ollama to tools like Claude Code. In those cases, the impact is even higher &#8212; all tool outputs flow to the Ollama server, get saved in the heap, and potentially end up in an attacker&#8217;s hands.\u00bb<\/p>\n<p>Users are advised to apply the latest fixes, limit network access, audit running instances for internet exposure, and isolate and secure them behind a firewall. It&#8217;s also recommended to deploy an authentication proxy or API gateway in front of all Ollama instances, as the REST API does not provide authentication out of the box.<\/p>\n<h3>Two Unpatched Flaws in Ollama Lead to Persistent Code Execution<\/h3>\n<p>The development comes as researchers at Striga <a href=\"https:\/\/www.striga.ai\/research\/ollama-windows-auto-update-rce\">detailed<\/a> two vulnerabilities in Ollama&#8217;s Windows update mechanism that can be chained into persistent code execution. The shortcomings remain unpatched following disclosure on January 27, 2026, and have been published following the elapse of a 90-day disclosure period.<\/p>\n<p>According to Bart\u0142omiej \u00abBartek\u00bb Dmitruk, co-founder of Striga, the Windows desktop client auto-starts on login from the Windows Startup folder, listens on 127.0.0[.]1:11434, and periodically polls for updates in the background via the \/api\/update endpoint to run any pending updates on the next app start.<\/p>\n<p>The identified vulnerabilities relate to a path traversal and a missing signature check that, when combined with the on-login routine, can permit an attacker with the ability to influence update responses to execute arbitrary code at every login. The flaws are listed below &#8211;<\/p>\n<ul>\n<li><strong>CVE-2026-42248<\/strong> (CVSS score: 7.7) &#8211; A missing signature verification vulnerability that does not verify the update binary prior to installation, unlike its macOS version.<\/li>\n<li><strong>CVE-2026-42249<\/strong> (CVSS score: 7.7) &#8211; A path traversal vulnerability that stems from the fact that the Windows updater creates the local path for the installer&#8217;s staging directory directly from HTTP response headers without sanitizing it.<\/li>\n<\/ul>\n<p>To exploit the flaws, the attacker needs to be in control of an update server that&#8217;s reachable by the victim&#8217;s Ollama client.In such a situation, it could lead to a scenario where an arbitrary executable is supplied as part of the update process and gets written to the Windows Startup folder without raising any signature check issues.<\/p>\n<p>To be able to control the update response, one approach involves overriding the OLLAMA_UPDATE_URL to point the client at a local server on plain HTTP. The attack chain also assumes AutoUpdateEnabled is on, which is the default setting.<\/p>\n<div class=\"dog_two clear\">\n<div class=\"cf\"><a href=\"https:\/\/thehackernews.uk\/ai-cant-stop-d\" rel=\"nofollow noopener sponsored\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"lazyload\" alt=\"Cybersecurity\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjPEV6-530TOlxG6PjrmdlY623wpBwduZ7t1HV6flcmO5R4q4AmfixDUzW0CrhlvMVNWbhvOIso-UDNTka4W_W9Chrdj_dglwBZwi7DuePM2IMIl-hfUYVIqBXgfpr_2619K8Gptb4LzwJ6gUbi7lWl2M8AFQJsHEaw63Q7tZ6708YGruiHrr0Y2W9YYxLQ\/s728-e100\/ThreatLocker-d.png\" width=\"729\" height=\"91\"\/><\/a><\/div>\n<\/div>\n<p>What&#8217;s more, the missing integrity check can lead to code execution on its own without the need for exploiting the path traversal vulnerability. In this case, the installer is dropped into the expected staging directory. During the next launch from the Startup folder, the update process is invoked without re-verifying the signature, causing the attacker&#8217;s code to be executed instead.<\/p>\n<p>That being said, the remote code execution is not persistent, as the next legitimate update overwrites the staged file. By adding the path traversal to the mix, a bad actor can redirect the executable to be written outside the usual path and achieve persistent code execution.<\/p>\n<p>According to CERT Polska, which <a href=\"https:\/\/cert.pl\/en\/posts\/2026\/04\/CVE-2026-42248\/\">took over<\/a> the coordinated disclosure process, Ollama for Windows versions 0.12.10 through 0.17.5 are vulnerable to the two flaws. In the interim, users are recommended to turn off automatic updates and remove any existing Ollama shortcut from the Startup folder (\u00ab%APPDATA%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\u00bb) to disable the silent on-login execution pathway.<\/p>\n<p>\u00abAny Ollama for Windows installation running version 0.12.10 through 0.22.0 is vulnerable,\u00bb Dmitruk said. \u00abThe path traversal writes attacker-chosen executables into the Windows Startup folder. The missing signature verification keeps them there: the post-write cleanup that would remove unsigned files on a working updater is a no-op on Windows. On the next login, Windows runs whatever was left behind.\u00bb<\/p>\n<p>\u00abThe chain produces persistent, silent code execution at the privilege level of the user running Ollama. Realistic payloads include reverse shells, info-stealers exfiltrating browser secrets and SSH keys, or droppers that pivot to additional persistence mechanisms. Anything that runs as the current user. Removing the dropped binary from the Startup folder ends the persistence, but the underlying flaws remain.\u00bb<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Cybersecurity researchers have disclosed a critical security vulnerability in Ollama that, if successfully exploited, could allow a remote, unauthenticated attacker to leak its entire process memory. The out-of-bounds read flaw,&hellip;<\/p>\n","protected":false},"author":1,"featured_media":866,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[75,950,1589,1590,972,1591,12,68],"class_list":["post-865","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-leak","tag-memory","tag-ollama","tag-outofbounds","tag-process","tag-read","tag-remote","tag-vulnerability"],"_links":{"self":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/865","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=865"}],"version-history":[{"count":0,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/posts\/865\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=\/wp\/v2\/media\/866"}],"wp:attachment":[{"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedigitalfortress.us\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}