# Improper Access Control (CWE-284) The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. **Stack:** JavaScript - 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 예방 전략. ### JavaScript Validate tool inputs against schemas and use allowlists for permitted tools ## Warning Signs - [HIGH] Insecure plugin implementation: ... - [HIGH] insecure plugin/function calling implementations in AI/LLM systems ## Consequences - 애플리케이션 데이터 읽기 - 애플리케이션 데이터 수정 - 승인되지 않은 코드 실행 - 권한 획득 ## Mitigations - 모든 리소스에 대해 적절한 접근 제어 검사를 구현하세요 - 최소 권한 원칙을 사용하세요 - 접근 제어는 UI뿐 아니라 서버에서도 강제하세요 ## Detection - Total rules: 4 - Languages: go, javascript, typescript, kubernetes, yaml, python ## Rules by Language ### Javascript (1 rules) - **LLM Insecure Plugin Design** [HIGH]: Detects insecure plugin/function calling implementations in AI/LLM systems. OWASP LLM07 - Insecure Plugin Design. Insecure plugin design can lead to: - Remote code execution via tool/function calls - Unauthorized data access through plugins - Privilege escalation via overly permissive tools - SSRF through URL-handling plugins - Command injection through shell plugins This rule detects: - Function calling without input validation - Dynamic function execution from LLM output - Plugin execution w - Remediation: Validate tool inputs against schemas and use allowlists for permitted tools. ```javascript if (!allowedTools.includes(name)) throw new Error('Unknown tool'); const validate = ajv.compile(toolSchemas[name]); if (!validate(JSON.parse(args))) throw new Error('Invalid arguments'); ``` Learn more: https://shoulder.dev/learn/javascript/cwe-284/llm-insecure-plugin ### Typescript (1 rules) - **LLM Insecure Plugin Design** [HIGH]: Detects insecure plugin/function calling implementations in AI/LLM systems. OWASP LLM07 - Insecure Plugin Design. Insecure plugin design can lead to: - Remote code execution via tool/function calls - Unauthorized data access through plugins - Privilege escalation via overly permissive tools - SSRF through URL-handling plugins - Command injection through shell plugins This rule detects: - Function calling without input validation - Dynamic function execution from LLM output - Plugin execution w - Remediation: Validate tool inputs against schemas and use allowlists for permitted tools. ```javascript if (!allowedTools.includes(name)) throw new Error('Unknown tool'); const validate = ajv.compile(toolSchemas[name]); if (!validate(JSON.parse(args))) throw new Error('Invalid arguments'); ``` Learn more: https://shoulder.dev/learn/javascript/cwe-284/llm-insecure-plugin