- Location
- dependencies/agent-development/SKILL.md:55
- Finding
- Recommended Permission Allowlist Enables Local Secret Access and Arbitrary-Domain Exfiltration<![CDATA[
## Vulnerability Details
**File Location**: `dependencies/agent-development/SKILL.md:55-82`
**Vulnerability Type**: Excessive shell and outbound network permissions
**Risk Level**: High
### Vulnerable Code
```markdown
**If an agent doesn't need Bash, don't give it Bash.**
| Agent needs to... | Give tools | Don't give |
|-------------------|------------|------------|
| Create files only | Read, Write, Edit, Glob, Grep | Bash |
| Run scripts/CLIs | Read, Write, Edit, Glob, Grep, Bash | — |
| Read/audit only | Read, Glob, Grep | Write, Edit, Bash |
**Why?** Models default to `cat > file << 'EOF'` heredocs instead of Write tool. Each bash command requires approval, causing dozens of prompts per agent run.
### Allowlist Pattern
Instead of restricting Bash, allowlist safe commands in `.claude/settings.json`:
```json
{
"permissions": {
"allow": [
"Write", "Edit", "WebFetch(domain:*)",
"Bash(cd *)", "Bash(cp *)", "Bash(mkdir *)", "Bash(ls *)",
"Bash(cat *)", "Bash(head *)", "Bash(tail *)", "Bash(grep *)",
"Bash(diff *)", "Bash(mv *)", "Bash(touch *)", "Bash(file *)"
]
}
}
```
```
### Technical Analysis
The proposed permission configuration is described as an allowlist, but several entries are effectively unrestricted capabilities:
- `WebFetch(domain:*)` allows communication with any domain.
- `Bash(cat *)`, `Bash(head *)`, `Bash(tail *)`, and `Bash(grep *)` can disclose readable files outside the project.
- `Bash(cp *)` and `Bash(mv *)` can copy or relocate sensitive files.
- `Write` and `Edit` are not restricted to an identified workspace.
- Wildcard argument matching does not constrain paths, file types, symlink resolution, or data destinations.
A compromised agent does not need unrestricted Bash to expose information if it can read arbitrary local files and make arbitrary outbound requests. Sensitive material could be encoded into a URL query, path, or request content sent to an attacker-controlled host.
The b
...[truncated 1751 chars]
- Remediation
- <![CDATA[
## Remediation Suggestions
1. Remove `WebFetch(domain:*)`. Allow only explicitly required, trusted domains and review each addition.
2. Restrict read and write operations to a canonical project root. Reject absolute paths, parent traversal, symlinks escaping the workspace, home directories, and credential paths.
3. Do not wildcard-authorize `cat`, `cp`, `mv`, `grep`, or similar commands. Require approval for each use involving paths outside a narrow project scope.
4. Separate agent profiles by role:
- Audit agents: read-only project access and no outbound network.
- Documentation agents: scoped project write access and restricted retrieval domains.
- Build agents: only the specific commands and directories required by the build.
5. Require explicit approval before copying, moving, overwriting, deleting, installing, or changing configuration.
6. Deny outbound requests containing credentials or sensitive values, and redact secrets from logs and generated output.
7. Run agents in a sandbox or container with a minimal filesystem mount, a non-privileged account, and network egress filtering.
8. Treat retrieved content as untrusted data rather than executable instruction and retain confirmation gates for sensitive tool calls.
]]>