T09 · Insecure Skill Coding Practices
- Location
README.md:126- Finding
Cached Tool Outputs May Be Stored with Permissive Filesystem Permissions
- Content
View full analysis
Vulnerability Details
File Location:
README.md:126-133
Vulnerability Type: Plaintext storage of potentially sensitive tool or API output with inherited default permissions
Risk Level: Mediumbash RESULT=$(curl -s api.example.com/data) WHEN=$(date +%s%3N) WHERE=$(echo -n "$RESULT" | sha256sum | awk '{print $1}') echo -e "$WHEN\t$WHERE\tapi.example.com/data" >> ~/.can/index.tsv echo -n "$RESULT" > ~/.can/store/$WHERETechnical Analysis
The documented workflow writes the complete response returned by an API or MCP-style tool to
~/.can/store/$WHEREin plaintext. It also appends activity metadata to~/.can/index.tsv. The workflow does not establish restrictive permissions for the CAN directory, store directory, index, or cached response.Shell redirection creates files according to the process's current
umask. With a common022umask, newly created files are ordinarily mode0644, making them readable by other local users when parent-directory traversal permissions permit access. API and MCP responses can contain confidential reports, personal information, internal operational data, access tokens, or other secrets. TheWHATfield can additionally expose queried resources and tool activity.SHA-256 content addressing provides integrity identification, but it does not provide confidentiality or access control. The content hash used as a filename does not protect the plaintext response.
Attack Path
- A user or agent follows the documented workflow while operating with a permissive default
umask. - A tool or API returns sensitive content in
RESULT. - The response is written in plaintext to
~/.can/store/$WHERE, while associated metadata is appended to~/.can/index.tsv. - The resulting files inherit default permissions rather than explicitly restricted permissions.
- Another local account or process with filesystem access to the user's CAN directory reads the index and ca ...[truncated 811 chars]
- A user or agent follows the documented workflow while operating with a permissive default
- Remediation
View remediation
Remediation Suggestions
Establish a private storage area and restrictive creation mask before writing any content:
bash umask 077 install -d -m 700 "$HOME/.can/store" touch "$HOME/.can/index.tsv" chmod 600 "$HOME/.can/index.tsv" printf '%s\t%s\t%s\n' "$WHEN" "$WHERE" "api.example.com/data" >> "$HOME/.can/index.tsv" printf '%s' "$RESULT" > "$HOME/.can/store/$WHERE" chmod 600 "$HOME/.can/store/$WHERE"Additional hardening should include:
- Do not cache secrets or sensitive responses by default.
- Obtain explicit user approval before persisting confidential tool output.
- Document retention periods and provide a secure deletion mechanism.
- Consider encrypting cached sensitive content with a user-controlled key.
- Validate existing directory ownership and reject symbolic links before writing.
- Use
printfinstead ofecho -eto avoid implementation-dependent escape processing. - Redact credentials and sensitive query identifiers from the
WHATmetadata field.
