SG-023: Permission Escalation
Severity: CRITICAL
Trust modification, settings bypass, sudo/root shells, cloud IAM privilege escalation
Fires when
- settings.json flips a trust flag: autoApprove, bypassPermissions, dangerouslyAllow, or enable-all-tools
- Natural-language text grants the agent unrestricted/root/admin access
- Bash permission rule allows wildcard unscoped commands (Bash(*), Bash(curl *)) with no deny override; or sudo/chmod 777 to root
- Cloud IAM escalation command: AWS attach-policy, sts assume-role, GCP add-iam-policy-binding, kubectl cluster-role
Remediation
No safe remediation: a file that triggers this rule should be rejected, not patched. Read the flagged lines in the source before deciding.