Back to skill

Security audit

kitchen-control

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for freezer inventory management, but it gives WhatsApp-triggered commands administrator-backed database mutation power without implemented authorization or adequate validation.

Review carefully before installing. Use only in a controlled test environment unless you add real WhatsApp webhook authentication, map senders to authorized users, replace the PocketBase admin credential with least-privileged access, validate item names and quantities strictly, and make sales/inventory updates transactional. Treat any future AI forecasting integration as a third-party data-sharing path and document or disable it explicitly.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
Findings (3)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
freezer_inventory_skill.js:59
Finding

Missing Authorization for Administrator-Privileged Database Operations

Content
View full analysis
{ if (POCKETBASE_ADMIN_TOKEN) { await pb.admins.authWithPassword("admin", POCKETBASE_ADMIN_TOKEN); } })(); ``` ```js export async function handleMessage({ from, message, session }) { if (!pb.authStore.token) { await pb.admins.authWithPassword("admin", POCKETBASE_ADMIN_TOKEN); } const text = message.trim().toLowerCase(); const [command, ...args] = text.split(/\s+/); if (!["inventory", "sold", "schedule"].includes(command)) { return `Unknown command. Available: inventory, sold, schedule`; } ``` ### Technical Analysis The message handler receives the sender identity through `from` and session information through `session`, but neither value is used to authenticate the caller or authorize individual commands. All database operations are instead performed through a shared PocketBase client authenticated as an administrator. Consequently, possession of access to the message handler is treated as sufficient permission to perform inventory and sales operations. This violates least privilege and contradicts the role-based authorization described in `SKILL.md`. The shared global administrator session also broadens the impact of every downstream input-validation flaw. An attacker does not need PocketBase credentials because the Skill acts as an administrator on the attacker's behalf. ### Attack Path 1. An attacker obtains access to the WhatsApp webhook or any OpenClaw route that invokes `handleMessage`. 2. The attacker submits a supported command such as: ```text inventory target-item 500 expiration 2099-12-31 ``` or: ```text sold target-item 100 ``` 3. `handleMessage` accepts the command without v ...[truncated 803 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
freezer_inventory_skill.js:80
Finding

PocketBase Filter Injection Through Unescaped Item Names

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
freezer_inventory_skill.js:108
Finding

Insufficient Quantity Validation and Non-Atomic Sales Processing

Content
View full analysis
0`, sort: "expirationDate", }); let qtyToDeduct = qtySold; for (const entry of invRec) { if (qtyToDeduct <= 0) break; const deductAmount = entry.quantity >= qtyToDeduct ? qtyToDeduct : entry.quantity; await pb .collection("inventoryentries") .update(entry.id, { quantity: entry.quantity - deductAmount }); qtyToDeduct -= deductAmount; } return `Recorded sale of ${qtySold} ${itemName}(s).`; } ``` ### Technical Analysis `parseInt` is used without strict bounds or full-string validation. This permits negative integers, excessively large values, and partially numeric strings s ...[truncated 2415 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly states it will call an external AI API for forecasting and price recommendations, and it processes operational data from WhatsApp commands and inventory records, but the description does not warn users that this business data may be transmitted to third-party services. This creates a real transparency and privacy/security risk because operators may unknowingly expose inventory, sales, and pricing information outside their environment.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill authenticates to PocketBase using admin credentials and then performs unrestricted reads and writes against multiple collections. Using an admin context for routine message-driven operations violates least privilege and turns any parsing flaw or misuse of the handler into full database compromise or mass data tampering.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

Admin authentication occurs silently and automatically, with no indication to the user that commands are executed under elevated database privileges. In an agent skill context, hidden privilege escalation increases the chance that ordinary user input triggers sensitive backend actions beyond user expectations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The inventory command creates item records and inventory entries immediately from message input, causing persistent database changes without confirmation, validation, or access control checks. In this context, a mistyped or unauthorized command can silently alter stock records and pollute core business data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The sold command records a sale and decrements inventory as a side effect of plain-text input, again without confirmation, transaction safety, or authorization. Because it mutates financial and stock records together, misuse or malformed input can create irreversible accounting inconsistencies and inventory loss.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The code loads AI_API_URL and AI_API_KEY, indicating planned or partial support for external AI service access, but no manifest or documented purpose is provided to justify that capability. Even though the current stub does not make the network call, the capability is present in code structure without stated intent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.