T09 · Insecure Skill Coding Practices
- Location
SKILL.md:79- Finding
Shell Command Injection Through User-Controlled Transaction Fields
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a plausible expense tracker, but it needs Review because it handles financial data with unsafe shell command templates, automatic digests, and inaccurate disclosure about Anthropic API data sharing.
Review carefully before installing. This skill should be acceptable only after the publisher replaces shell-string command templates with argument-array execution, gives explicit opt-in for Anthropic parsing and digest generation, removes local-only privacy claims, adds a local-only mode, and documents storage, deletion, heartbeat disablement, and data retention behavior.
SKILL.md:79Shell Command Injection Through User-Controlled Transaction Fields
README.md:120Financial Data Is Transmitted Externally Despite Local-Only Privacy Claims
The skill description presents a simple local expense tracker, but the detected behavior includes undeclared external API usage via ANTHROPIC_API_KEY and incomplete/possibly unimplemented digest/storage behavior. In context, users may disclose highly sensitive financial activity assuming local processing, while their messages could be transmitted to a third party without clear disclosure or permission.
The README defines logging behavior as triggered by "Any expense message," which is overly broad for a chat-based skill handling free-form conversation. In practice, this can cause unintended financial records to be created from ambiguous messages, quoted text, forwarded content, or casual discussion, reducing integrity of the user's transaction history and potentially leaking sensitive text into local records or downstream LLM parsing.
The skill invokes local Python scripts, writes transaction data, and accesses an API key, but it declares no explicit tool scope or permission boundaries. That creates an authorization gap: the runtime may grant broader shell, file, or env access than users or reviewers expect, which is risky for a finance-related skill handling sensitive spending data.
The activation rules match on generic amounts, common verbs, and ordinary spending-related words in both English and Bengali, making accidental triggering likely. In a financial logging skill, false activation can silently capture unrelated chat content as transaction records or route sensitive user text into parser tooling, increasing privacy and integrity risks.
The heartbeat sends weekly spending digests proactively, with no warning, consent flow, or privacy controls. Because the content concerns personal financial transactions, unsolicited summaries could expose sensitive data to anyone viewing notifications or shared devices, and the risk is elevated by the Bangladesh-focused consumer-finance context.
This skill stores sensitive personal financial transaction history in plaintext JSON on local disk without any explicit warning, consent prompt, or mention of retention/security at the point of use. On shared devices, compromised user accounts, backups, or overly permissive filesystem settings, this can expose spending habits, notes, and payment method metadata to other local users or software.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
def save(transactions: list):
ensure_storage()
with open(TRANSACTIONS_FILE, "w", encoding="utf-8") as f:
json.dump(transactions, f, indent=2, ensure_ascii=False)
The code transmits full user transaction messages to Anthropic via client.messages.create, which is a real third-party data exfiltration path. For a finance-related skill handling spending, remittance, and payment details, this can expose sensitive personal and financial information beyond what users would reasonably expect from a local transaction logger.
The parser sends raw transaction text to an external API without any disclosure or warning in the code path, so users may unknowingly share sensitive financial content with a third party. In this skill context, messages may contain spending habits, family remittances, amounts, and payment methods, making undisclosed sharing more privacy-sensitive than in a generic chatbot.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def get_stats() -> dict:
"""Get this week's stats from logger"""
result = subprocess.run(
["python3", str(LOGGER), "stats"],
capture_output=True, text=True
)
The weekly digest sends transaction-derived spending data, including totals, categories, and payment methods, to Anthropic's external API. For a finance-tracking skill, this is sensitive behavioral data exfiltration to a third party, and the metadata/description does not clearly disclose that summaries are processed remotely.
Weekly spending data is transmitted to an external model without any in-code user notice, consent flow, or warning. In the context of a Bangladesh-focused expense tracker handling financial habits and payment-method breakdowns, undisclosed outbound sharing is more sensitive and can violate user expectations around local bookkeeping.
A Bangladesh-focused transaction tracker and weekly digest skill does not inherently require access to environment-managed credentials unless external services are part of the declared scope. This code depends on ANTHROPIC_API_KEY, revealing an undeclared integration capability beyond straightforward local tracking and reporting.
No suspicious patterns detected.