T09 · Insecure Skill Coding Practices
- Location
SKILL.md:229- Finding
Unrestricted Proposal Path Allows Arbitrary JSON File Processing and Deletion
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a coherent APS knowledge-base purpose, but its documented write and commit flows are too broad and could persist or modify sensitive local business data unexpectedly.
Install only if you are comfortable with an APS agent maintaining a local, Git-backed memory of customer rules and scheduling decisions. Before using it with real customer data, tighten path validation, restrict Git staging to approved files, avoid storing raw conversation quotes or secrets, define retention/deletion rules, and use a pinned dependency environment.
SKILL.md:229Unrestricted Proposal Path Allows Arbitrary JSON File Processing and Deletion
SKILL.md:150Unvalidated Identifiers Permit Path Traversal and Arbitrary File Overwrite
SKILL.md:103Untrusted Vector-Index Metadata Can Cause Reads Outside the Knowledge Base
SKILL.md:329Broad Git Staging Can Commit Unrelated or Sensitive Repository Files
references/scripts.md:24Unpinned ChromaDB Installation Instruction Creates Supply-Chain Risk
Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.
for rule_id, meta in zip(results["ids"][0], results["metadatas"][0]): path = kb / meta["file_path"] rules.append(json.loads(path.read_text())) return rules
### Load a problem schema template
The description says to use the skill for many broad situations, including when the agent 'needs to understand what knowledge is available before making scheduling decisions' or 'wants to persist something learned in a conversation.' Those conditions are not narrowly bounded to specific trigger phrases or exclusion cases, which could cause the skill to be invoked for common scheduling tasks whenever knowledge might be relevant.
The skill encourages persisting conversation-derived customer information into a long-term filesystem knowledge base by default. That creates a data retention risk because sensitive operational details, personal data, or confidential client instructions may be stored indefinitely in plain files, indexed for retrieval, and committed to Git, expanding exposure and making deletion difficult.
L140-L141 states that the agent 'NEVER writes directly to the main knowledge directories' and that all new knowledge goes to pending_review first. However, the confirmation flow for client memory updates in L268-L278 modifies client_memory/_profile.json directly in the live knowledge base, which contradicts that absolute claim about write behavior.
The proposal flow stores raw source quotes and session identifiers in persistent JSON files. If users share credentials, personal data, commercial terms, or sensitive shop-floor information in conversation, this design preserves that material verbatim and links it to a session, increasing disclosure risk through later reads, backups, indexing, or Git history.
The skill instructs the agent to present the proposal confirmation prompt using fixed Chinese text, but it does not offer the user a language or locale choice. This creates a language policy issue because the skill forces a specific language regardless of user preference or prior opt-in.
Persistent logging of scheduling decisions and session history can accumulate sensitive operational intelligence, user-provided content, and rule-usage patterns over time. In a local filesystem plus Git-backed design, those records may be broadly readable to local users, retained longer than intended, and difficult to purge once committed.
This markdown file documents a script that deletes the existing domain_rules collection and rebuilds it from scratch, which can remove the current index state. Although the embedded code has a brief comment about a clean rebuild, the user-facing markdown description does not clearly warn that running the script performs a destructive reset.
This section documents a helper that increments use_count, updates last_used_at, writes the rule JSON file back to disk, and may update ChromaDB metadata. The markdown description says it is called after each scheduling session, but it does not clearly warn users that persistent rule records are automatically modified.
The heading at L357 describes deprecation as a soft disable that should prevent normal use, and the comment at L369 says the rule is removed from the vector index so it won't be retrieved. But the code at L372 updates the indexed metadata to status: deprecated rather than deleting the entry, so the implementation does not match the comment's stated action.
This markdown file includes a natural-language schema example that sets "language": "zh-CN" as the client preference. Because the file does not indicate that language is selectable, optional, or region-specific, it can be read as enforcing a specific locale without user opt-in.
The markdown instructs users to paste an inline helper that writes _index.json, but the surrounding description does not explicitly disclose that it modifies on-disk index metadata. For markdown-scoped warning checks, user-facing documentation should mention file modification when behavior affects stored data.
No suspicious patterns detected.