# Improper Access Control (CWE-284) The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor. **Stack:** JavaScript - Prevalence: Élevée Fréquemment exploitée - Impact: Élevé 3 règles de sévérité élevée - Prevention: Documentée 4 exemples de correctifs **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 Stratégies de prévention pour Improper Access Control basées sur 1 règles de détection Shoulder. ### 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 - Lecture des données de l'application - Modification des données de l'application - Exécuter du code non autorisé - Obtenir des privilèges ## Mitigations - Mettez en place des contrôles d'accès appropriés sur toutes les ressources - Appliquez le principe du moindre privilège - Appliquez les contrôles d'accès côté serveur, et pas seulement dans l'interface ## 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