August 25, 2026
Your Model Is Safe. Your Runtime Isn’t.
There is a comforting version of local AI security where all we need to do is inspect the model.

By izm1chael
4 min read
Check the format.
Reject Pickle.
Validate the tensors.
Verify the repository.
Run the model.
Unfortunately, the model is only half of the interaction.
The other half is the software that parses it, allocates memory for it, tokenizes requests, executes kernels, exposes network APIs and manages the resulting inference process.
A perfectly benign model can become dangerous when loaded into a vulnerable runtime.
This is conventional vulnerability management meeting the AI stack.
1. The Runtime Is Trusted Code Processing Untrusted Input
The relationship looks like:
UNTRUSTED MODEL
↓
MODEL LOADER
↓
INFERENCE ENGINE
↓
CPU / GPU / FILESYSTEM / NETWORKUNTRUSTED MODEL
↓
MODEL LOADER
↓
INFERENCE ENGINE
↓
CPU / GPU / FILESYSTEM / NETWORKEven if the model has no malicious intent, malformed or edge-case data can reach vulnerabilities in the parser and runtime.
And even if the model is completely well-formed, network requests or prompts can reach vulnerabilities in the serving layer.
The attack surface includes much more than the tensors.
2. llama.cpp Is an Excellent Case Study
llama.cpp is enormously influential in local AI and is embedded or incorporated into many applications and workflows.
Its popularity also makes its security history useful for understanding the problem.
In 2026 alone, advisories included multiple memory-safety issues affecting GGUF handling and server/RPC functionality.
CVE-2026–27940 involved integer overflow during GGUF parsing, leading to an undersized heap allocation and out-of-bounds write.
CVE-2026–33298 involved tensor size calculations and potential heap corruption when processing crafted model dimensions.
CVE-2026–34159 affected the RPC backend and involved unsafe tensor deserialization logic that could lead to arbitrary memory access in exposed vulnerable deployments.
These issues are not an argument against llama.cpp.
They are an argument against assuming that a popular inference engine is permanently safe merely because millions of people use it.
Complex native software needs patch management.
3. A Clean Model Can Trigger a Vulnerable Code Path Accidentally
Security conversations often assume exploitation requires a deliberately weaponised model.
That is not always the operational risk we should care about.
A legitimate model might contain a structural feature or metadata value that reaches a bug in an old runtime simply because the model was produced by a newer toolchain or uses a feature the old parser handles incorrectly.
So there are at least two cases:
malicious artifact → deliberately targets vulnerability
benign artifact → accidentally reaches vulnerabilitymalicious artifact → deliberately targets vulnerability
benign artifact → accidentally reaches vulnerabilityPatch management protects against both.
4. Bundled Dependencies Hide the Real Version
A user may say:
"We do not run llama.cpp."
They run a desktop local-AI application.
That application may bundle llama.cpp or another native inference component internally.
The security question becomes:
Which engine is bundled?
Which commit/version?
Which patches were backported?
When was the application built?
Does its update mechanism replace the vulnerable component?Which engine is bundled?
Which commit/version?
Which patches were backported?
When was the application built?
Does its update mechanism replace the vulnerable component?The application version alone may not tell us enough.
AI software increasingly vendors large dependency stacks, and vulnerability management needs visibility into those transitive components.
5. Python Environments Add Another Layer
A Python-based model stack may include:
Python
PyTorch
Transformers
Tokenizers
Safetensors
Accelerate
NumPy
Jinja2
ONNX / ONNX Runtime
CUDA bindings
custom model codPython
PyTorch
Transformers
Tokenizers
Safetensors
Accelerate
NumPy
Jinja2
ONNX / ONNX Runtime
CUDA bindings
custom model codEach package has its own version and advisory history.
Then native wheels may include compiled C/C++/CUDA components.
The practical runtime identity is therefore closer to an SBOM than a single version string.
A model-admission decision can become environment-specific:
Model X + Runtime Stack A → acceptable
Model X + Runtime Stack B → blocked due to known vulnerable componentModel X + Runtime Stack A → acceptable
Model X + Runtime Stack B → blocked due to known vulnerable componentThe model has not changed.
The risk has.
6. Network Exposure Changes the Threat Model
A local inference engine bound only to loopback is different from the same service exposed to a network.
A server with:
0.0.0.0:PORT0.0.0.0:PORTmay accept requests from other machines depending on firewall and network configuration.
That introduces:
- unauthenticated API exposure
- prompt/request parser attack surface
- denial-of-service risk
- cross-user data leakage
- model-management endpoints
- potentially vulnerable RPC functionality
Calling software "local AI" does not guarantee the service itself is local-only.
Security tools should inspect effective listening interfaces and configuration, not the product category.
7. Multi-Tenant Inference Is a Different Security Problem
A single developer running a model on a laptop has one threat model.
A shared GPU server serving multiple teams has another.
Now we care about:
request isolation
conversation isolation
prompt leakage
KV/cache handling
temporary files
shared model caches
GPU memory reuse
API authentication
rate limits
per-tenant permissions
logging boundariesrequest isolation
conversation isolation
prompt leakage
KV/cache handling
temporary files
shared model caches
GPU memory reuse
API authentication
rate limits
per-tenant permissions
logging boundariesA runtime designed primarily for trusted local use may not automatically provide the isolation expected from a multi-tenant production service.
This should influence admission and deployment policy.
8. Runtime Configuration Can Reintroduce Dangerous Features
A patched library can still be configured unsafely.
Examples include:
enabling remote custom code
allowing untrusted model locations
exposing management APIs
enabling experimental RPC features
running as root
mounting sensitive host directories
providing unrestricted outbound networking
sharing writable cachesenabling remote custom code
allowing untrusted model locations
exposing management APIs
enabling experimental RPC features
running as root
mounting sensitive host directories
providing unrestricted outbound networking
sharing writable cachesVulnerability scanning cannot replace secure configuration.
The environment needs a policy too.
9. GPU Acceleration Expands the Trusted Computing Base
Local AI frequently depends on:
GPU drivers
CUDA / ROCm
vendor libraries
custom kernels
compiler/runtime componentsGPU drivers
CUDA / ROCm
vendor libraries
custom kernels
compiler/runtime componentsMoving tensor operations to a GPU does not remove the security boundary. It expands the software stack that must process model-controlled shapes, buffers and operations correctly.
Most users do not need to become GPU security researchers.
They do need to keep drivers and runtime components maintained and avoid assuming that "the model runs on the GPU" means the host is insulated from problems.
10. Runtime Advisories Should Be Matched Against the Model Path
A generic vulnerability database result is only the beginning.
Useful security tooling should answer:
Which runtime is installed?
Which version/commit?
Which model format will be loaded?
Which vulnerable component handles it?
Is the vulnerable feature enabled?
Is the model source untrusted?
Is the affected network endpoint exposed?Which runtime is installed?
Which version/commit?
Which model format will be loaded?
Which vulnerable component handles it?
Is the vulnerable feature enabled?
Is the model source untrusted?
Is the affected network endpoint exposed?This allows a precise result.
For example:
Finding: VULNERABLE_MODEL_LOADER
Runtime: llama.cpp
Build: prior to patched build X
Artifact: GGUF from untrusted source
Relevant advisory: CVE-...
Exposure: model will be parsed locally
Decision: block until runtime updatedFinding: VULNERABLE_MODEL_LOADER
Runtime: llama.cpp
Build: prior to patched build X
Artifact: GGUF from untrusted source
Relevant advisory: CVE-...
Exposure: model will be parsed locally
Decision: block until runtime updatedThat is much more useful than dumping every CVE associated with every dependency.
11. Sandboxing Is the Backstop
Patching reduces known vulnerabilities.
Sandboxing limits the impact of unknown ones.
A model-loading process generally does not need unrestricted access to:
SSH keys
browser profiles
cloud credentials
home directories
Docker sockets
host package managers
internal network rangesSSH keys
browser profiles
cloud credentials
home directories
Docker sockets
host package managers
internal network rangesA constrained execution environment can apply:
- unprivileged users
- read-only filesystems
- explicit model directories
- restricted outbound network access
- process limits
- memory/CPU/GPU limits
- syscall controls where practical
- container or VM isolation depending on risk
This is especially valuable when evaluating untrusted models before production admission.
12. Patch State Is Part of the Admission Decision
This creates a useful conceptual change.
Instead of asking:
"Did the model pass?"
Ask:
"Is this model permitted to run in this environment?"
The answer can change without the model changing.
If a critical vulnerability is disclosed tomorrow against the deployed loader, yesterday's approved model may need to be temporarily quarantined from that runtime until the environment is fixed.
That is normal security lifecycle management.
AI artifacts should not be exempt from it.
The Bottom Line
A safe model cannot compensate for a vulnerable runtime.
The security object is the interaction between:
MODEL
+
LOADER
+
INFERENCE ENGINE
+
DEPENDENCIES
+
CONFIGURATION
+
HOST ENVIRONMENTMODEL
+
LOADER
+
INFERENCE ENGINE
+
DEPENDENCIES
+
CONFIGURATION
+
HOST ENVIRONMENTModel scanning without runtime awareness is incomplete.
Runtime vulnerability scanning without artifact awareness is incomplete too.
The strongest admission decision combines both.
Do not ask only whether the model is safe enough to trust. Ask whether the exact model/runtime combination is safe enough to execute.