Back to skill

Security audit

PocketLens

Security checks for vulnerabilities and agentic risk

Overview

This is a real PocketLens expense-tracking integration, but it handles sensitive financial images and can automatically post transactions with too little user confirmation and unsafe command guidance.

Review this skill carefully before installing. Use a write-only key if possible, avoid full-access keys, do not set POCKET_LENS_API_URL unless you control and trust the endpoint, and require the agent to preview extracted transactions before sending them. Be cautious with receipts or card/banking screenshots because they may contain personal financial details that will be processed by AI and sent to PocketLens.

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)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:69
Finding

Shell Command Injection Through Transaction JSON Interpolation

Content
View full analysis
' ``` Where `` is a JSON object with the transaction fields. For multiple transactions, wrap them in a `transactions` array: ```bash node pocket-lens.mjs create-transaction '{"transactions": [{"merchant": "스타벅스", "amount": 5500, "date": "2025-12-05T14:30:00+09:00", "cardName": "신한카드", "categoryHint": "카페"}]}' ``` ### Technical Analysis The Skill instructs the Agent to insert transaction JSON directly into a single-quoted shell command. Transaction fields originate from untrusted sources, including user messages and text extracted from receipts, card statements, banking screenshots, and other images. A single quote within a merchant name, description, card name, or other extracted field can terminate the shell argument. Additional shell syntax can then be interpreted before Node.js starts. The `JSON.parse` call in `scripts/pocket-lens.mjs` does not mitigate this issue because shell parsing occurs before the JSON reaches the script. For example, if attacker-controlled text is inserted into the command without safe argument handling, a value containing a sequence conceptually similar to: ```text '; attacker_command; # ``` could terminate the JSON argument and append a separate shell command. Exploitation depends on the Agent executing the documented command through a shell, as the Skill explicitly demonstrates with Bash-style syntax. ### Attack Path 1. An attacker supplies a crafted transaction description, merchant name, or receipt image containing shell metacharacters and a single quote. 2. The image or message is processed, and the malicious text is preserved in a transaction field. 3. The Agent follows `SKILL.md` and interpolates the resulting JSON into the documented si ...[truncated 959 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/pocket-lens.mjs:20
Finding

Bearer Credential and Financial Data Exposure Through an Unrestricted API Base URL

Content
View full analysis
`. Transaction creation requests also include sensitive financial information such as merchant names, amounts, dates, card names, categories, and descriptions. The default destination, `https://pocketlens.app`, is consistent with the declared functionality. However, if the environment variable is accidentally or maliciously changed, the script sends the bearer credential and financial payload to the configured host. A plaintext `http://` URL is also accepted, allowing network interception. This network behavior is necessary only when communicating with an authorized PocketLens deployment. Allowing arbitrary destinations without validation exceeds the minimum privilege and destination ...[truncated 1454 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Note
Location
README.md:24
Finding

Documentation Encourages Overprivileged Full-Access API Keys

Content
View full analysis
API Keys**. 3. Click **Create New Key**. 4. Set the permission to **write** (or **full**). 5. Copy the generated key (starts with `pk_`). ``` The recommendation is repeated later in the same file: ```markdown - The API key must have **write** or **full** permission to create transactions. - Go to PocketLens Settings > API Keys and create a new key with the correct permission. ``` It is also reflected in `SKILL.md:236`: ```markdown | 403 | Insufficient permissions | "API 키에 쓰기 권한이 없습니다. write 또는 full 권한이 있는 키를 생성해주세요." / "Your API key lacks write permission. Please create a key with write or full access." | ``` ### Technical Analysis The documentation states that write permission is sufficient but also recommends full access as an acceptable alternative. Full access is broader than the stated requirement to create transactions and retrieve the information exposed through the declared API commands. This does not independently bypass PocketLens authorization. However, it causes users to provision credentials with more authority than the Skill needs. The excess authority amplifies other credential-exposure risks, particularly the unrestricted API destination in `scripts/pocket-lens.mjs`. ### Attack Path 1. A user follows the setup documentation and creates a full-access API key rather than a narrowly scoped key. 2. The key is made available to the Skill through `POCKET_LENS_API_KEY`. 3. The key is subsequently exposed through configuration compromise, endpoint redirection, local process access, or another credential-disclosure event. 4. An attacker uses the key with all permissions granted by its full-access scope. 5. The attacker may perform PocketLens operations ...[truncated 602 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (5)

Session Persistence

Medium
Category
Rogue Agent
Confidence
60% confidence
Finding

Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

Content

Scanner excerpt · README.md (reported line 27)May include surrounding context.

md
1. Log in to [PocketLens](https://pocketlens.app).
2. Go to **Settings > API Keys**.
3. Click **Create New Key**.
4. Set the permission to **write** (or **full**).
5. Copy the generated key (starts with `pk_`).

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README encourages users to upload receipts, card statements, and banking screenshots, but it does not clearly warn that these images may contain sensitive financial and personal data that will be processed by AI and transmitted to an external service. In a finance-focused skill, this omission undermines informed consent and can lead users to disclose card, billing, merchant, and transaction data without understanding the privacy implications.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill invokes external scripts, depends on an API key, and performs network-backed financial operations, but it does not declare an explicit tool scope such as allowed-tools or permissions. That creates a trust and containment gap: a host may grant broader execution or network capability than users expect, increasing the risk of unauthorized data access or transaction creation if the skill is triggered unexpectedly or modified later.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The activation rules are very broad and can trigger on ordinary financial chats or whenever receipt/card images are shared, even without an explicit request to use PocketLens. In this skill, broad activation is especially risky because the skill can process sensitive financial images and create write-side transactions via an API, which could lead to privacy exposure or unwanted recording of financial data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The create-transaction command transmits sensitive financial data such as merchant, amount, and date to a remote PocketLens API, but the CLI itself provides no explicit confirmation, notice, or consent checkpoint in the operation path. In an agent-skill context, this is risky because a user may share receipts or card screenshots for analysis without realizing the data will be persisted or forwarded to an external service.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/pocket-lens.mjs:20