T09 · Insecure Skill Coding Practices
- Location
SKILL.md:28- Finding
Potentially Sensitive Notes Stored in Plaintext with Inherited File Permissions
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 28 and 41–43
Vulnerability Type: Plaintext storage of potentially sensitive data with insufficiently controlled permissions
Risk Level: LowVulnerable Code
python NOTES_FILE = os.path.join(os.path.dirname(__file__), "quick_notes.json")python def _save(self): with open(NOTES_FILE, "w", encoding="utf-8") as f: json.dump(self.notes, f, ensure_ascii=False, indent=2)Technical Analysis
The implementation stores all note content in an unencrypted JSON file located beside the skill code. Notes may contain personal information, tasks, private ideas, or other sensitive material.
The file is created through Python's standard
open()function without explicitly restricting its permissions. Its effective permissions therefore depend on the process environment and operating-system umask. In an environment with an overly permissive umask or a shared project directory, other local users or processes may be able to read the file.The implementation also describes the storage as private, but it does not provide encryption, access-control validation, or explicit filesystem permission enforcement. Plaintext storage alone does not protect data from users or processes that can access the underlying file.
Attack Path
- A victim runs the skill and records private information.
- The
_save()method writes the notes toquick_notes.jsonin plaintext. - The execution environment creates the file with permissions derived from its current umask and parent-directory access controls.
- A local user or compromised process with filesystem access locates the skill directory.
- If the resulting permissions allow access, that actor reads
quick_notes.jsonand obtains the stored note content.
Exploitation requires pre-existing local filesystem access and sufficiently permissive file or directory permissions. The reviewed code ...[truncated 529 chars]
- Remediation
View remediation
Remediation Suggestions
- Store notes in an operating-system-appropriate per-user data directory rather than beside the skill code.
- Create the parent directory with permissions limited to the owning user, such as
0700on POSIX systems. - Create the notes file atomically with owner-only permissions, such as
0600on POSIX systems, rather than relying solely on the ambient umask. - Validate and correct existing file permissions when loading an already-created notes file.
- Use authenticated encryption if the application intends to protect notes from users or processes that can read the underlying file.
- Manage encryption keys through an operating-system credential store or another dedicated secret-management mechanism; do not hardcode keys in the skill.
- Document the actual security boundary accurately and avoid describing plaintext local persistence as inherently private.
