Risk OS Red Try Stoa

AI005 · STOA-LLM05-UNPINNED-MODEL

Model, endpoint, or artifact dependency observed without a pin or integrity control.

Detection — four variants

variantpatternseverity
trust-remote-codefrom_pretrained(..., trust_remote_code=True)high
unpinned-artifactfrom_pretrained("org/model") with no revision=; torch.load/pickle.load of a downloaded artifactmedium
floating-aliasa model string that is a known undated alias (gpt-4o, claude-3-5-sonnet, …) or ends -latestlow
insecure-endpointbase_url/api_base set to a plaintext non-local http:// URL (supersedes NET001); or read from config with no allowlist (dynamic_endpoint, info)medium / info

Not flagged: dated snapshots (gpt-4o-2024-08-06), revision=-pinned artifacts, local endpoints, alias strings in test paths. The alias table ships in data/model_aliases.toml and is overridable.

Vulnerable → remediated

# VULNERABLE
AutoModel.from_pretrained("someorg/reranker", trust_remote_code=True)
ChatOpenAI(model="gpt-4o", base_url=os.environ["LLM_BASE_URL"])

# REMEDIATED
AutoModel.from_pretrained("someorg/reranker", revision="a1b2c3d")
ChatOpenAI(model="gpt-4o-2024-08-06", base_url=validated_base)

Finding message

{construct} permits execution of / loads repository-supplied code or a model artifact with no pin or integrity control observed (OWASP LLM05). Consider pinning a reviewed revision or dated snapshot.

Suppress: # stoa: ignore[AI005] reason