# 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: 높음 자주 악용됨 - Impact: 높음 3개의 높은 심각도 규칙 - Prevention: 문서화됨 4개의 수정 예시 **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 1개의 Shoulder 탐지 규칙을 기반으로 한 Inclusion of Untrusted Functionality 예방 전략. ### 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 - 승인되지 않은 코드 실행 - 애플리케이션 데이터 읽기 - 애플리케이션 데이터 수정 ## Mitigations - 신뢰할 수 있는 검증된 출처의 코드만 포함하세요 - 외부 스크립트에는 Subresource Integrity(SRI)를 사용하세요 - 실행 가능한 코드의 출처를 제한하기 위해 Content Security Policy(CSP)를 구현하세요 ## 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