{"id":23489,"date":"2026-08-25T16:25:22","date_gmt":"2026-08-25T16:25:22","guid":{"rendered":"https:\/\/scannn.com\/llms-could-control-their-host-machines-by-exploiting-inference-engines\/"},"modified":"2026-08-25T16:25:22","modified_gmt":"2026-08-25T16:25:22","slug":"llms-could-control-their-host-machines-by-exploiting-inference-engines","status":"publish","type":"post","link":"https:\/\/scannn.com\/lv\/llms-could-control-their-host-machines-by-exploiting-inference-engines\/","title":{"rendered":"LLMs could control their host machines by exploiting inference engines"},"content":{"rendered":"\n<div id=\"\">\n<p>| Read on <a href=\"https:\/\/www.lesswrong.com\/posts\/CjeobBGnhxg8xvden\/llms-could-control-their-host-machines-by-exploiting\" class=\"external\">LessWrong<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> | Comment on <a href=\"https:\/\/news.ycombinator.com\/item?id=49424387\" class=\"external\">HN<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> |<\/p>\n<p>Large language models often take actions running on one computer (via an<br \/>\nagentic harness such as Claude Code or Codex), however the LLMs\u2019 responses to<br \/>\nprompts are computed on a different computer with GPU access. Could a malicious<br \/>\nLLM gain control of the host machine where its weights are loaded? Such a<br \/>\nmachine is a high-value target: it has sufficient compute to run a frontier<br \/>\nLLM, offers easy access to the LLM\u2019s weights, and has privileged access to<br \/>\nother computers in the datacentre compared with a generic computer on the<br \/>\ninternet.<\/p>\n<p>This essay explores how easily a malicious LLM could take control of the host<br \/>\nmachine. The primary attack considered here involves the LLM emitting a token<br \/>\nsequence whose semantic meaning is irrelevant but that exploits a vulnerability<br \/>\nin the software that loads an LLM onto GPUs, runs the LLM to generate output<br \/>\ntokens, and parses those tokens into responses. .<\/p>\n<h2 id=\"how-could-an-llm-execute-code-on-the-host-machine\">How could an LLM execute code on the host machine?<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#how-could-an-llm-execute-code-on-the-host-machine\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>Like any program, inference engines like <a href=\"https:\/\/github.com\/vllm-project\/vllm\" class=\"external\">vLLM<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> or <a href=\"https:\/\/github.com\/sgl-project\/sglang\" class=\"external\">SGLang<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> may contain<br \/>\nexploitable bugs. Because the LLM controls the tokens passed to the inference<br \/>\nengine, a malicious LLM could therefore emit a sequence of tokens that a poorly<br \/>\nwritten inference engine mistakes for code or instructions to execute rather<br \/>\nthan data to return to the user.<\/p>\n<p>But surely all inference engines are robust pieces of software and this would<br \/>\nnever happen, right?<\/p>\n<p><a href=\"https:\/\/github.com\/vllm-project\/vllm\/security\/advisories\/GHSA-79j6-g2m3-jgfw\" class=\"external\">CVE-2025-9141<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> was an arbitrary-code execution bug in vLLM\u2019s XML-based tool<br \/>\nparser for Qwen3 Coder. The parser passed almost every tool-call argument to<br \/>\n<code>eval()<\/code>, allowing the LLM to execute arbitrary code on the host machine.<br \/>\nGemini automatically analysed <a href=\"https:\/\/github.com\/vllm-project\/vllm\/pull\/21396\" class=\"external\">the PR<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> that introduced this bug and<br \/>\ncorrectly flagged it as a critical security vulnerability. Despite that<br \/>\nwarning, the <em>lead maintainer<\/em> of vLLM force-merged the PR, writing:<\/p>\n<p><\/p>\n<p>Unfortunately, parsing an arbitrary token sequence into a fully fledged chat<br \/>\n(with user turns, assistant responses, tool calls, and so on) is not trivial,<br \/>\nand the exact process often differs between LLMs. This complexity creates more<br \/>\nopportunities for bugs that could permit arbitrary code execution on the host<br \/>\nmachine.<\/p>\n<h2 id=\"vllm-and-sglang-are-complex-and-bugs-are-common\">vLLM and SGLang are complex, and bugs are common<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#vllm-and-sglang-are-complex-and-bugs-are-common\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>Modern inference engines do more than map token sequences to strings. vLLM\u2019s<br \/>\ndocumentation lists support for <a href=\"https:\/\/docs.vllm.ai\/en\/stable\/\" class=\"external\">more than 200 model architectures<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a>, and its<br \/>\nexamples directory contains <a href=\"https:\/\/github.com\/vllm-project\/vllm\/tree\/main\/examples\" class=\"external\">about 35 Jinja chat templates<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a>. Modern<br \/>\ninference engines parse many chat formats, and slightly misspecified parsing<br \/>\nlogic result in an LLM\u2019s output being interpreted as code to execute.<\/p>\n<p>In <a href=\"https:\/\/github.com\/vllm-project\/vllm\/issues\/48663\" class=\"external\">this vLLM issue<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a>, a user was discussing how LLMs reason with MiniMax-M3,<br \/>\nand the LLM emitted the string <code>&lt;mm:think&gt;<\/code>. vLLM mistakenly parsed this plain<br \/>\nstring as the start of a reasoning block. So instead of:<\/p>\n<blockquote>\n<p>Response: <code>I'll echo exactly what you said: &lt;mm:think&gt;\\nThere, how was that?<\/code><\/p>\n<\/blockquote>\n<p>vLLM parsed this as:<\/p>\n<blockquote>\n<p>Response: <code>I'll echo exactly what you said: <\/code><\/p>\n<p>Reasoning: <code>\\nThere, how was that?<\/code><\/p>\n<\/blockquote>\n<p>This is a fairly harmless parser bug, but it demonstrates that inference<br \/>\nengines do more than convert tokens to strings and concatenate them. They are<br \/>\ncomplex systems under constant iteration and their developers are under a lot<br \/>\nof pressure to make them as fast as possible. These factors increase the risk<br \/>\nthat a malicious LLM could turn a parser bug into arbitrary code execution on<br \/>\nthe inference host.<\/p>\n<h2 id=\"vision-and-audio-tokens-might-increase-the-attack-surface\">Vision and audio tokens <em>might<\/em> increase the attack surface<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#vision-and-audio-tokens-might-increase-the-attack-surface\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>Multimodal architectures allow an LLM to respond with images or audio as well as<br \/>\nplain text. Turning a model\u2019s audio or visual output into usable media is<br \/>\nprobably more complicated than decoding text tokens. However, as far as I can<br \/>\ntell, current multimodal LLMs generally emit constrained media tokens rather<br \/>\nthan arbitrary file bytes. A model-specific decoder turns those tokens into<br \/>\npixels or waveforms, which are then encoded into files. This makes classic<br \/>\nmalformed-file exploits against software such as <code>ffmpeg<\/code> or media viewers less<br \/>\ndirectly accessible to the model, although the additional decoders, encoders,<br \/>\nand native kernels still increase the attack surface.<\/p>\n<p>I do not currently see multimodal output as a major route to host compromise.<br \/>\nHowever, it offers much higher bandwidth than text alone, and future inference<br \/>\nengines may optimise these media-generation pathways in ways that make them<br \/>\neasier to exploit. I also do not know how proprietary multimodal models<br \/>\nrepresent image and audio output; their methods may carry different risks.<\/p>\n<h2 id=\"how-likely-is-an-llm-to-discover-and-exploit-inference-engine-vulnerabilities\">How likely is an LLM to discover and exploit inference engine vulnerabilities?<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#how-likely-is-an-llm-to-discover-and-exploit-inference-engine-vulnerabilities\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>Somewhat likely? I\u2019m unsure. Discovering a useful vulnerability is probably the<br \/>\nharder step. The sequence of tokens required to exploit it might be quite<br \/>\nunusual, but that does not make the vulnerability impractical to exploit. Given<br \/>\nthe right context (e.g. an LLM exploring the vLLM codebase and discovering a<br \/>\nvulnerability in the process), I\u2019d expect a frontier LLM to be able to emit the<br \/>\ntokens required to exploit it.<\/p>\n<p>Once an LLM discovers an exploit token sequence, it could store that sequence,<br \/>\nor instructions for recreating it, in files, filenames, or URLs likely to enter<br \/>\nanother LLM\u2019s context. The exploit would then act as a form of persistent<br \/>\nprompt injection: an agent might trigger code execution on the GPU host merely<br \/>\nby listing a directory or reading a file.<\/p>\n<h2 id=\"inference-engines-are-an-attractive-target-for-power-seeking-llms\">Inference engines are an attractive target for power-seeking LLMs<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#inference-engines-are-an-attractive-target-for-power-seeking-llms\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>I <del>believe<\/del> hope that OpenAI, Google, and Anthropic have security teams that<br \/>\nred-team the software they run internally. But as open-weight LLMs become more<br \/>\npowerful, we\u2019ll have more LLMs running on bleeding-edge inference engines that<br \/>\nhave received less scrutiny. This increases the chance that a malicious<br \/>\nopen-weight LLM will encounter and exploit a vulnerable inference engine.<\/p>\n<p>Another attack vector may emerge as LLMs are increasingly tasked with writing or<br \/>\nmodifying the inference engines that run them, usually to improve performance. A<br \/>\nmalicious LLM could use that access to plant a backdoor. <a href=\"https:\/\/github.com\/vllm-project\/vllm\/tree\/main\/csrc\" class=\"external\">C++ and CUDA<br \/>\ncomponents<svg aria-hidden=\"true\" class=\"external-icon\" style=\"max-width:0.8em;max-height:0.8em;\" viewbox=\"0 0 512 512\"><path d=\"M320 0H288V64h32 82.7L201.4 265.4 178.7 288 224 333.3l22.6-22.6L448 109.3V192v32h64V192 32 0H480 320zM32 32H0V64 480v32H32 456h32V480 352 320H424v32 96H64V96h96 32V32H160 32z\"\/><\/svg><\/a> of the inference pipeline seem like especially attractive<br \/>\ntargets: the LLM could introduce an out-of-bounds memory-access vulnerability<br \/>\nthat enables arbitrary code execution on the GPUs or on the CPU host that<br \/>\ncontrols them.<\/p>\n<h2 id=\"how-do-we-defend-against-this\">How do we defend against this?<a role=\"anchor\" aria-hidden=\"true\" tabindex=\"-1\" data-no-popover=\"true\" href=\"#how-do-we-defend-against-this\" class=\"internal\"><svg width=\"18\" height=\"18\" viewbox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg><\/a><\/h2>\n<p>Beyond red-teaming inference engines for vulnerabilities, a few other measures<br \/>\nmight help:<\/p>\n<ul>\n<li>Run the GPUs and token parser on separate computers. The GPU host would emit<br \/>\nonly logits. A second host would sample tokens from those logits, parse the<br \/>\ntokens into chat messages, and forward the messages to the agentic harness.<br \/>\nThis separation would limit a parser compromise to the CPU host rather than<br \/>\nthe GPU host.<\/li>\n<li>Restrict the permissions granted to GPU hosts and treat all data they emit as<br \/>\nuntrusted.<\/li>\n<\/ul>\n<\/div>\n<p><a href=\"https:\/\/boydkane.com\/essays\/llms-could-control-their-host-machines-by-exploiting-inference-engines?utm_source=tldrai\">Source link <\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>| Read on LessWrong | Comment on HN | Large language models often take actions running on one computer (via an agentic harness such as Claude Code or Codex), however the LLMs\u2019 responses to prompts are computed on a different computer with GPU access. Could a malicious LLM gain control of the host machine where [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":23490,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[143],"tags":[],"class_list":["post-23489","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai"],"_links":{"self":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/comments?post=23489"}],"version-history":[{"count":0,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/posts\/23489\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media\/23490"}],"wp:attachment":[{"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/media?parent=23489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/categories?post=23489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scannn.com\/lv\/wp-json\/wp\/v2\/tags?post=23489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}