A vulnerable loading path usually shows up when documentation, examples, or compatibility features still allow deserialisation of untrusted artefacts. Warning signs include support for legacy checkpoints, code execution during model load, and security controls that apply only to newer formats. If loading a model can trigger unexpected behavior, the path needs investigation as a potential runtime exploit surface.
Warning signs that the loading path itself can be abused
A model loading path becomes suspicious when the loader is treated as a convenience layer rather than a security boundary. The clearest warning signs are trust being granted to artefacts before they are validated, compatibility pathways that still accept legacy formats, and “helpful” loading behaviour that can run code, instantiate objects, or resolve references during import. For readers assessing this problem, the question is not whether the model is legitimate in theory, but whether the load step can be reached with attacker-influenced content.
That matters because a loading path often sits upstream of the rest of the stack: if the model is loaded unsafely, the compromise happens before policy enforcement, monitoring, or inference controls can help. Documentation that normalises unsafe deserialisation, or examples that encourage broad compatibility over verification, is often the first clue that the runtime surface has grown beyond what the security model assumes. NIST’s control guidance on safe system configuration and code execution boundaries is a useful reference point for thinking about this class of weakness: NIST SP 800-53 Rev 5 Security and Privacy Controls. In practice, teams usually discover the issue only after a legacy format or convenience loader has already been left in place for too long.
How shadow exploit exposure shows up in real loading workflows
Shadow exploits depend on a gap between what the loader is expected to do and what it is actually allowed to do. A safe loading path should be narrow: it should accept a known format, validate structure before execution, and keep deserialisation separate from code execution. When that separation is blurred, the path becomes attractive because an attacker does not need to break the model itself. They only need a file, checkpoint, or package that is accepted by the loader and interpreted too permissively.
- Legacy checkpoint support remains enabled even though newer, safer formats exist.
- Load-time hooks, custom object reconstruction, or plugin resolution occur before integrity checks.
- Compatibility settings allow “best effort” loading instead of fail-closed rejection.
- Security controls are applied after the load has already happened, not before.
In practice, the strongest indicator is not a single feature but a chain of permissive design choices. Documentation that tells users to “just load” third-party artefacts, sample code that deserialises without restricting object types, or loaders that silently fall back to older mechanisms all widen the surface. That is especially dangerous in shared model hubs, CI pipelines, and automated deployment flows, where the loading event may be repeated across environments with little human review.
Teams should also watch for behavioural clues after loading. If a model import can trigger unexpected file access, network activity, excessive CPU use, or object creation that is not essential to inference, the loader is doing more than reading weights. That is where shadow exploit paths begin to resemble general code-execution risk rather than a simple model integrity issue.
Where the loader is strict, isolated, and format-limited, this guidance becomes much less useful because the attack path collapses to ordinary file validation rather than exploitable deserialisation.
When compatibility, convenience, or mixed formats create false confidence
Tighter compatibility often increases operational convenience, requiring organisations to balance migration speed against load-time trust. The tradeoff is that the same feature that keeps older pipelines working can also preserve a risky execution path long after the organisation believes it has moved on.
One common edge case is a mixed estate: safer formats may be introduced for new models while older checkpoints remain loadable for existing workloads. That is not automatically a problem, but it becomes one when policy assumes the newer path protects the older one. Another edge case is a wrapper around the loader that looks secure at the application layer but delegates to an unsafe underlying library. In those cases, the visible interface is not the real control point.
Guidance versus consensus matters here. There is broad agreement that untrusted deserialisation is dangerous, but teams do not always agree on how far compatibility support should go. Some organisations prefer hard removal of legacy load paths; others accept them only inside isolated build or conversion environments. The right answer depends on whether the artefact source is controlled and whether the loader can execute anything beyond plain data parsing.
Another gotcha is assuming that “signed model files” automatically eliminate risk. Signing helps with provenance, but it does not make a loader safe if it still performs dangerous deserialisation or resolves embedded behaviours at load time. The trust question is not just who created the file, but what the loader is permitted to do with it.
For teams comparing tooling, the most reliable boundary is whether the loader can be forced to treat the artefact as inert data only. If it cannot, the path remains a candidate shadow exploit surface even when the model itself appears well managed.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while CIS Controls v8, NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A2 — Unsafe Tool Use and Execution | Load-time code execution or object reconstruction is an unsafe execution boundary. |
| Recommendation — Restrict model loading to inert data parsing and block any load path that can execute code. | ||
| MITRE ATLAS | AML.TA0002 — ML Supply Chain Compromise | Unsafe artefacts and legacy loaders create a supply-chain entry point into the runtime. |
| Recommendation — Hunt for compromised artefacts and remove load paths that accept untrusted model packages. | ||
| CIS Controls v8 | 6 — Access Control Management | Permissive loading paths often reflect weak control over who can introduce executable artefacts. |
| Recommendation — Limit who can publish or place loadable artefacts into production paths. | ||
| NIST CSF 2.0 | PR.DS — Data Security | The issue concerns integrity and safe handling of model artefacts at rest and during loading. |
| Recommendation — Protect model artefacts so the loading process cannot treat untrusted content as trusted data. | ||
| NIST AI RMF | MAP 3.2 — Context and Scope Definition | Shadow exploit risk depends on defining the model loading boundary and trust assumptions clearly. |
| Recommendation — Define the loading boundary so provenance, format, and execution assumptions are explicit. | ||
Practitioner Guidance
What to prioritise: Treat the load path as a security control point, not a convenience function. The first thing to verify is whether any supported format, fallback, or compatibility mode can still trigger code execution, object reconstruction, or unsafe deserialisation.
What practitioners underestimate: Shadow exploit exposure often survives policy upgrades because old examples, conversion tools, and deployment wrappers stay in circulation after the formal standard has changed. That makes documentation and sample code part of the attack surface, not just the loader implementation.
What good looks like: The load path rejects untrusted or ambiguous artefacts by default, uses explicit allowlists for supported formats, and separates provenance checks from any parsing step that could execute behaviour.
Escalation / exception: If a legacy format must remain supported, restrict it to a controlled conversion environment with strong segregation and a documented end-of-life date. Treat any production exception as a time-bound risk decision, not a permanent compatibility feature.
Practitioner takeaway: The key judgement is whether the loader can be trusted to remain inert under attacker-influenced input; if not, the organisation should assume the exploit path exists until proven otherwise.
Related resources from NHI Mgmt Group
- What are the signs that a Python application may be vulnerable to BadHost style path confusion?
- What are the signs that Android file sharing code is vulnerable to path traversal?
- What are the signs that a legacy tenant, test system, or shadow API is becoming an attack path?
- What are the signs that a Rails application may be vulnerable to path traversal?