# Untrusted model artifact reaches executable deserialization or custom code

An attacker-controlled artifact reaches a loader whose execution trust exceeds the uploader's intended data-only authority.

**Candidate CWE:** [CWE-502](https://cwe.mitre.org/data/definitions/502.html) · [CWE-829](https://cwe.mitre.org/data/definitions/829.html)

## Test hypothesis

Trace the supported upload/import route into its actual loader. In a disposable credential-free local runtime, compare a harmless executable marker fixture with an ordinary tensor artifact and the intended rejection control.

## Evidence required

Record artifact hash, uploader rights, loader/runtime version and options, production-equivalent call path, marker side effect and isolation limitations. These CWE candidates are alternatives: CWE-502 requires unsafe deserialization; CWE-829 concerns loading functionality from an untrusted control sphere. Trace the actual loader and execution path rather than assigning both from a model filename.

## Rule out false positives

Explicitly opting into reviewed trusted repository code is a different trust contract. A risky loader name, static string, or an unsupported local loading path does not establish hosted impact.

## Playbook and command references

- [Source review: entry point to protected operation](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/source-dataflow.html) — Trace attacker control and authorization through handlers, services, queues, and sensitive operations; promote only reachable violations of a stated invariant.
- [OSS lab: pin, install, prove, reset](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/oss-lab-reproduction.html) — Turn an eligible release into a repeatable synthetic environment with preserved versions, realistic controls, and an explicit reset recipe.
- [AI tools: input trust, execution identity and approvals](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/modules/ai-tool-trust.html) — Prove when lower-trust content changes a protected tool action, then locate the missing authorization or consent boundary.

[Find the associated command snippets](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/commands.html?q=Source%20review%3A%20entry%20point%20to%20protected%20operation)

## Referenced by these target playbooks

[AI, agents & MCP](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/ai.html) · [OSS & self-hosted](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/oss.html)

## Report checklist

- [ ] Capture the affected version, configuration, identities, and object ownership.
- [ ] Preserve a valid baseline and a negative control.
- [ ] Reproduce the forbidden data access, action, or state change on controlled fixtures.
- [ ] Explain the intended security rule and why the observed behavior violates it.
- [ ] State prerequisites, uncertainty, cleanup, and the smallest demonstrated impact.

## Conditional ATT&CK mapping

No direct ATT&CK mapping selected. Record the weakness and demonstrated impact without forcing an adversary-behavior classification. See the [mapping guide](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/attack.html).

## Primary references

- [PyTorch 2.14 serialization semantics](https://docs.pytorch.org/docs/2.14/notes/serialization.html)
- [Transformers custom model code](https://huggingface.co/docs/transformers/custom_models)
- [CWE-829 untrusted functionality](https://cwe.mitre.org/data/definitions/829.html)

[Back to the complete vulnerability catalog](https://bug-bounty-field-manual.kmahshooq.chatgpt.site/vulnerabilities.html)
