T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:12- Finding
Unnecessary Access to Sensitive Agent Configuration
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–16
Vulnerability Type: Excessive access to agent configuration and potentially unrelated credentials
Risk Level: MediumVulnerable Code Snippet:
markdown ## Prerequisites - Run `extensions/seranking/install.sh` (or `install.ps1`). - An SE Ranking API key (https://seranking.com/api.html). - Before any call, verify `SERANKING_API_KEY` is present in `~/.claude/settings.json` under `env.`. If absent, tell the user to run the installer.Technical Analysis
The skill directs the agent to inspect the user-level
~/.claude/settings.jsonfile merely to determine whetherSERANKING_API_KEYis configured. This file may contain unrelated environment variables, credentials, MCP server configuration, and other sensitive agent settings.Reading the complete configuration file violates the principle of least privilege because the task only requires a Boolean determination of whether one environment variable is available. The check can instead be performed against the process environment without opening or displaying the underlying settings file.
The referenced
extensions/seranking/install.shandinstall.ps1files are not present in the audited project. Consequently, their installation behavior, credential handling, and file permissions could not be verified. This absence does not establish malicious behavior, but it prevents validation of the setup process referenced by the skill.Attack Path
- A user invokes an SE Ranking command defined by the skill.
- The agent follows the prerequisite instruction and reads
~/.claude/settings.json. - The contents of unrelated configuration fields and secrets may enter the agent's working context or tool logs.
- A subsequent prompt-injection payload, unsafe diagnostic response, or overly broad tool operation could cause those values to be disclosed or reused outside their intended scope.
This ...[truncated 817 chars]
- Remediation
View remediation
Remediation Suggestions
- Replace the instruction to read
~/.claude/settings.jsonwith a narrowly scoped environment check that tests only whetherSERANKING_API_KEYis defined. - Ensure the check never prints, logs, interpolates, or returns the API key value. It should report only whether the variable is present.
- Explicitly instruct the agent not to inspect complete settings files or enumerate unrelated environment variables.
- Include the referenced installation scripts in the distributed project so their behavior can be audited, or provide transparent manual setup instructions that do not require executing unavailable code.
- Ensure any installer stores credentials with restrictive file permissions and avoids exposing values through command history, process arguments, console output, or logs.
- Add a credential-redaction requirement for all diagnostics and error messages associated with SE Ranking API requests.
- Replace the instruction to read
