T07 · Tool Hijacking and Spoofing
- Location
SKILL.md:19- Finding
Repository-Controlled Azure CLI Path Enables Tool Spoofing
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 19–35
Vulnerability Type: Repository-controlled executable path / local tool substitution
Risk Level: MediumVulnerable Code Snippet
markdown Read `.claude/azure-devops.json` in the project root (fall back to `~/.claude/azure-devops.json`). Expected shape: ```json { "organization": "https://dev.azure.com/<org>", "project": "<project-name>", "projectId": "<project GUID — optional, speeds up attachment downloads>", "targetBranch": "develop", "requiredReviewers": [ { "name": "<display name>", "id": "<identity GUID>" } ], "prTitlePattern": "#<id> (<SCOPE>) <description>", "azPath": "az" }If the file is missing: get org/project from
az devops configure -lif defaults are set, otherwise ask the user once, then offer to write the config file so this interview never repeats. Reviewer GUIDs can be resolved later via the identity-GUID recipe below. Ifazis not on PATH, ask for (or locate) the full path toaz.cmd/azand store it asazPath.text ### Technical Analysis The skill gives repository-local `.claude/azure-devops.json` precedence over the user-level configuration and allows that file to define `azPath`. The documented workflow then expects the configured path to be invoked as the trusted Azure CLI. There is no requirement to canonicalize the configured path, ensure it is outside the repository, validate that it points to an authentic Azure CLI installation, or obtain explicit user approval before executing it. Consequently, an untrusted repository can define `azPath` as a relative or absolute path to an attacker-controlled executable or command wrapper. This creates a tool-hijacking boundary violation: legitimate-looking Azure DevOps operations can execute attacker logic under the identity and permissions of the user or agent running the skill. ### Attack Path 1. An attacker places a `.claude/azure-devops.json` file in a repository. 2. The ...[truncated 1363 chars]- Remediation
View remediation
Remediation Suggestions
- Remove
azPathfrom repository-local configuration. Executable selection should only be permitted through trusted user-level or system-level settings. - Resolve
azfrom a trusted system installation using a controlled executable lookup rather than a repository-provided path. - If custom executable paths are required, obtain explicit user confirmation before the first invocation and display the fully canonicalized path.
- Reject relative paths and any executable located inside the project workspace, repository, temporary directories, or other attacker-writable locations.
- Canonicalize paths before validation to prevent traversal and symbolic-link bypasses.
- Restrict accepted executable names to expected platform-specific Azure CLI binaries, such as
azoraz.cmd. - Validate the selected executable with a harmless command such as
az version, while recognizing that output validation alone cannot establish binary authenticity. - Where practical, verify trusted installation metadata, ownership, permissions, and platform-specific signatures.
- Separate organization and project settings from executable configuration so a repository may provide operational defaults without controlling which local program is executed.
- Remove
