T09 · Insecure Skill Coding Practices
- Location
SKILL.md:220- Finding
MCP Write Operations Lack an Enforced Authorization or Confirmation Gate
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:220-235
Related Evidence:references/agent-guardrails.md:11-22,references/cli-reference.md:3-5
Vulnerability Type: Missing authorization gate for state-changing identity operations
Risk Level: HighVulnerable documentation and effective behavior:
text The skill delivers reads and writes and records them; it does **not** decide whether a write is permitted. That is your agent's judgement, or the permission of the account you connect it with (a Keycloak service account or authentik token without `manage-*` scope — writes then fail at the server). There is no read-only switch, policy file, or approval gate. - **Audit is the guarantee, and it is not bypassable.** Every call — MCP and CLI alike — lands an audit row in `~/.identity-aiops/audit.db` (relocatable via `IDENTITY_AIOPS_HOME`): params, status, and the risk tier. - `IDENTITY_AUDIT_APPROVED_BY` / `IDENTITY_AUDIT_RATIONALE` are optional annotations recorded on the row (who/why); they are never required and never block. - **Risk tier** — a descriptive label on the audit row derived from `risk_level` (`enable_user`, `update_client_redirect_uris`, `rotate_client_secret` = high; `disable_user`, `revoke_user_sessions`, `require_password_reset` = medium); it gates nothing. Writes support `--dry-run` and double confirmation at the CLI.Technical Analysis
The Skill exposes state-changing MCP operations while explicitly delegating authorization to the agent's judgment or the permissions of the connected IdP account. It provides no enforced read-only mode, policy gate, mandatory approval token, or confirmation requirement for direct MCP calls.
The CLI's
--dry-runand double-confirmation controls do not protect the direct MCP execution path. Optional audit fields and risk labels only record context; the documentation expressly states that they never block exec ...[truncated 2173 chars]- Remediation
View remediation
Remediation Suggestions
- Make all direct MCP writes dry-run by default.
- Require a short-lived, operation-bound approval token before execution. Bind it to the exact tool, target identity or client, proposed parameters, and expiration time.
- Display the complete proposed change and require explicit operator approval before issuing the token.
- Add an enforced read-only mode that removes or rejects all write tools regardless of model instructions.
- Require stronger confirmation for irreversible actions such as session revocation and client-secret rotation.
- Convert
IDENTITY_AUDIT_APPROVED_BYandIDENTITY_AUDIT_RATIONALEfrom optional annotations into validated approval evidence where policy requires it. - Retain audit logging and risk labels, but treat them as defense-in-depth rather than authorization controls.
- Configure the IdP account with the minimum necessary roles so an authorization failure cannot affect resources outside the intended operational scope.
