# Inclusion of Functionality from Untrusted Control Sphere (CWE-829) The product imports, requires, or includes executable functionality from a source that is outside of the intended control sphere. **Stack:** Go - Prevalence: Hoch Häufig ausgenutzt - Impact: Hoch 3 Regeln mit hohem Schweregrad - Prevention: Dokumentiert 4 Fix-Beispiele **OWASP:** Vulnerable and Outdated Components (A06:2021-Vulnerable and Outdated Components) - #6 ## Description When software includes functionality from untrusted sources (such as third-party scripts, external modules, or code from untrusted URLs), attackers can inject malicious code that will be executed with the same privileges as the application. ## Prevention Präventionsstrategien für Inclusion of Untrusted Functionality basierend auf 1 Shoulder-Erkennungsregeln. ### Go Use an allowlist for permitted models, verify integrity with checksums, and load models over HTTPS only ## Warning Signs - [HIGH] Potential supply chain vulnerability: ... - [HIGH] supply chain vulnerabilities in AI/LLM implementations such as untrusted model sources or dynamic mo ## Consequences - Nicht autorisierten Code ausführen - Anwendungsdaten lesen - Anwendungsdaten ändern ## Mitigations - Nur Code aus vertrauenswürdigen, verifizierten Quellen einbinden - Subresource Integrity (SRI) für externe Skripte verwenden - Content Security Policy (CSP) einsetzen, um Quellen ausführbaren Codes einzuschränken ## Detection - Total rules: 4 - Languages: go, javascript, typescript, yaml, python ## Rules by Language ### Go (1 rules) - **LLM Supply Chain Vulnerabilities** [HIGH]: Detects supply chain vulnerabilities in AI/LLM implementations such as untrusted model sources or dynamic model loading. - Remediation: Use an allowlist for permitted models and verify integrity with checksums. ```go if _, ok := allowedModels[modelID]; !ok { return errors.New("model not in allowlist") } ``` Learn more: https://shoulder.dev/learn/go/cwe-829/llm-supply-chain