T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:69- Finding
Overly Broad Secret Scan May Expose Unrelated Workspace Credentials
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, line 69
Vulnerability Type: Excessive access to unrelated workspace files and sensitive output exposure
Risk Level: MediumVulnerable Code:
bash grep -RInE 'password|passwd|secret|token|api[_-]?key|BEGIN .*PRIVATE|private[_-]?key|cookie|credential' SKILL.md . 2>/dev/null || trueTechnical Analysis
The command recursively searches both
SKILL.mdand the entire current directory (.). The stated purpose is to validate the skill source before publication, but recursively inspecting the surrounding workspace exceeds what is necessary when only the target skill file needs review.When a matching expression is found,
grepprints the complete matching line by default. Consequently, unrelated configuration files, environment files, source code, backups, or credential stores within the working directory may have their sensitive values written to terminal output, agent context, execution logs, or retained conversation history.The
2>/dev/nullredirection suppresses permission and traversal errors, reducing visibility into which locations could not be scanned. The trailing|| truealso forces a successful command status, potentially concealing operational failures. These constructs are not direct exploitation mechanisms, but they make the scan less transparent.Attack Path
- A user invokes the documented skill-publishing workflow from a repository or workspace root.
- The agent executes the recommended secret-scanning command.
- The recursive
.operand causesgrepto inspect files unrelated to the targetSKILL.md. - An unrelated file contains a line matching a term such as
token,password,cookie, orprivate_key. grepprints the complete matching line, potentially including the actual secret value.- The exposed value becomes visible in terminal output, agent context, audit logs, or conversation records.
No networ ...[truncated 788 chars]
- Remediation
View remediation
Remediation Suggestions
-
Restrict the scan to the intended skill file rather than recursively scanning the current workspace:
bash grep -nE 'password|passwd|secret|token|api[_-]?key|BEGIN .*PRIVATE|private[_-]?key|cookie|credential' -- SKILL.md || true -
Avoid printing complete matching lines when they may contain secret values. Prefer a dedicated secret scanner that supports redaction, or report only filenames, line numbers, and rule identifiers.
-
If directory scanning is genuinely required, require explicit user approval and use a narrowly defined path with exclusions for files such as
.env, credential stores, private keys, build artifacts, dependency directories, and version-control metadata. -
Run the scan with the minimum necessary filesystem permissions and from a dedicated staging directory containing only the publication artifact.
-
Do not suppress all errors unconditionally. Surface inaccessible paths and scanner failures so the user can determine whether the review was complete.
-
Require manual review of sanitized findings before any public gist, repository, or marketplace upload.
-
