# Improper Access Control (CWE-284) The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. **Stack:** Go - Prevalence: 高 频繁被利用 - Impact: 高 3 条严重级别为高的规则 - Prevention: 已记录 4 个修复示例 **OWASP:** Broken Access Control (A01:2021-Broken Access Control) - #1 ## Description Access control involves determining which subjects can access which objects. When access control is implemented incorrectly, it can lead to unauthorized access to sensitive data or functionality. ## Prevention 基于 1 条 Shoulder 检测规则的 Improper Access Control 预防策略。 ### Go Validate tool inputs against strict schemas and use an allowlist for permitted tools ## Warning Signs - [HIGH] Insecure plugin implementation: ... - [HIGH] insecure plugin/function calling implementations in AI/LLM systems without proper validation ## Consequences - 读取应用程序数据 - 修改应用程序数据 - 执行未授权代码 - 获取权限 ## Mitigations - 对所有资源实施适当的访问控制检查 - 采用最小权限原则 - 在服务器端而不仅是 UI 层强制执行访问控制 ## Detection - Total rules: 4 - Languages: go, javascript, typescript, kubernetes, yaml, python ## Rules by Language ### Go (1 rules) - **LLM Insecure Plugin Design** [HIGH]: Detects insecure plugin/function calling implementations in AI/LLM systems without proper validation. - Remediation: Validate tool inputs against strict schemas and use an allowlist for permitted tools. ```go if _, ok := toolRegistry[toolCall.Name]; !ok { return errors.New("unknown tool") } ``` Learn more: https://shoulder.dev/learn/go/cwe-284/llm-insecure-plugin