T09 · Insecure Skill Coding Practices
- Location
scripts/main.py:76- Finding
Undisclosed Plaintext Persistence of User-Provided Learning Data
- Content
View full analysis
Vulnerability Details
File Location:
scripts/main.py:76-86andscripts/main.py:118-128
Vulnerability Type: Plaintext storage of potentially sensitive user data
Risk Level: MediumVulnerable Code
python # Save reflection data = { "type": "reflection", "task": task, "approach": approach, "prompts": prompts[:4], "timestamp": datetime.now().isoformat() } with open("reflection_log.json", "a", encoding="utf-8") as f: f.write(json.dumps(data, ensure_ascii=False) + "\n")python # Save strategy data = { "type": "strategy", "subject": subject, "difficulty": difficulty, "strategies": strategies, "timestamp": datetime.now().isoformat() } with open("strategy_log.json", "a", encoding="utf-8") as f: f.write(json.dumps(data, ensure_ascii=False) + "\n")Technical Analysis
The
reflectandstrategycommands automatically append user-provided data to predictable files namedreflection_log.jsonandstrategy_log.jsonin the current working directory. The stored fields can contain personal learning tasks, approaches, subjects, and reported difficulties.The data is retained as unencrypted JSON Lines without explicit user consent, configurable retention, an opt-out option, or application-enforced restrictive file permissions. File permissions therefore depend on the process environment and system
umask. In a shared or broadly accessible working directory, another local account or process may be able to read the records.Neither
README.mdnorSKILL.mddocuments this persistence side effect. Consequently, users may provide information under the assumption that it is used only for the current invocation.This is not a privilege-escalation vulnerability and does not transmit data over a network. Exposure is limited to data entered into these commands and depends on local filesystem access.
Attack Path
...[truncated 1093 chars]
- Remediation
View remediation
Remediation Suggestions
- Disable persistent logging by default and require an explicit option such as
--save. - Clearly disclose what data is stored, where it is stored, and how long it is retained before requesting consent.
- Permit users to choose the destination through an explicit path argument rather than writing to the current working directory.
- Create log files with owner-only permissions, such as mode
0600, using an atomic creation mechanism that prevents unsafe existing-file handling. - Minimize retained data by omitting raw task, approach, subject, or difficulty text unless it is necessary.
- Add configurable retention and deletion controls, including a command for securely clearing saved records.
- Consider encrypting retained records when the application is expected to process sensitive educational information.
- Handle filesystem errors explicitly and notify the user whether persistence succeeded or failed.
- Update
README.mdandSKILL.mdto document the persistence behavior and associated privacy implications.
- Disable persistent logging by default and require an explicit option such as
