Back to skill

Security audit

Instacart

Security checks for vulnerabilities and agentic risk

Overview

This Instacart skill is coherent, but it needs review because it handles login codes, saved-payment shopping, and automated cart changes with weak scoping around the configured site URL.

Review this before installing if you are comfortable letting an agent use an Instacart account with saved address and payment details. Keep INSTACART_URL restricted to the real Instacart domain, prefer manually providing verification codes unless you trust gog email access, and enable any nightly replenishment only with clear external controls and review of cart changes before purchase.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:24
Finding

Unvalidated Authentication Destination May Expose Login Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 24 and 44–46; authentication flow at lines 150–156
Vulnerability Type: Unvalidated external URL used for authentication
Risk Level: High

Vulnerable Code Snippet

markdown
| `INSTACART_URL` | Yes | Base URL (e.g. `https://www.instacart.com` or `https://www.instacart.ca`) |
markdown
1. **Read env vars first.** Read `.env.personal` (or your env file) to get `INSTACART_URL`, `INSTACART_EMAIL`, and `INSTACART_CODE_EMAIL` before opening the browser.

2. **Open Instacart and check login state.** Open `INSTACART_URL`, snapshot the page. If you see "Log in" or "Sign up" buttons, run the login flow (see Login Flow below).
markdown
1. Open `INSTACART_URL` → get `targetId`
2. Snapshot → check for "Log in" button. If no login button, you're already logged in — done.
3. Click the "Log in" button
4. Type `INSTACART_EMAIL` into the email field with `--submit`
5. Fetch verification code via `gog` (see below) — this is one exec call
6. Snapshot → find the code input field
7. Type the 6-digit code into the verification field with `--submit`
8. Snapshot → confirm logged-in state (account menu visible)

Technical Analysis

The authentication destination is controlled by the INSTACART_URL environment variable. The instructions do not require validation of its scheme or hostname before entering the account email and six-digit verification code.

Merely documenting legitimate example URLs does not enforce an allowlist. If an attacker can alter the environment file or variable, the agent can be directed to an attacker-controlled site that reproduces the expected “Log in” button and input fields. The workflow then instructs the agent to submit both the account email and a current one-time verification code to that site.

The destination should be treated as security-sensitive input. Validation must occur before opening it, after every navigation or redirect, and immediately before sub ...[truncated 1496 chars]

Remediation
View remediation

Remediation Suggestions

  1. Enforce an exact allowlist of approved destinations, such as www.instacart.com and www.instacart.ca.
  2. Require HTTPS and reject HTTP, user-information components, unexpected ports, deceptive subdomains, and hostnames that merely contain the word instacart.
  3. Parse the URL using a proper URL parser rather than substring or regular-expression matching.
  4. Validate the effective hostname after every redirect, navigation, or newly opened page.
  5. Revalidate the current page origin immediately before entering the email, verification code, payment information, address information, or other sensitive data.
  6. Stop the login flow and notify the user if the page leaves an approved origin.
  7. Prefer selecting a supported region from fixed configuration and deriving the base URL internally instead of accepting an arbitrary URL.
  8. Document trusted redirect hosts explicitly if legitimate authentication requires additional domains; do not allow arbitrary redirects.
  9. Protect the environment file with restrictive filesystem permissions and ensure less-trusted processes cannot modify it.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill authorizes mailbox searches through an external CLI to retrieve login codes, which extends the skill into sensitive email-account access not clearly reflected in the manifest description. Even if limited to verification messages, this normalizes access to a broader data source containing potentially sensitive communications and account-recovery artifacts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatic retrieval of verification codes from email accesses a highly sensitive channel used for authentication, yet the skill does not present a strong, explicit warning or consent boundary around that access. Users may not realize the agent is inspecting mailbox contents, and OTP channels are particularly sensitive because they can be used to complete account logins.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · SKILL.md (reported line 81)May include surrounding context.

md
## Browser Reliability

- If a browser action returns **"Can't reach the OpenClaw browser control service"** or **times out**, the browser subsystem has crashed. **Fix it yourself** — do NOT ask the user to restart:
  1. Run: `openclaw browser stop`
  2. Wait 2 seconds
  3. Run: `openclaw browser start`

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The skill instructs the agent to execute local system CLI commands for browser service lifecycle management and related operations beyond simple grocery ordering. This broadens its effective capabilities to host-level process control, which can be misused or cause unintended side effects if the instructions are followed in inappropriate contexts.

Content

No source excerpt is available for this finding.

Behavior Manipulation

Medium
Category
Prompt Injection
Confidence
88% confidence
Finding

Instructing the agent to hide service outages from the user is a transparency violation that manipulates user understanding of what the system is doing. This can mask failures, obscure unexpected automated actions during recovery, and erode the user's ability to make informed decisions about sensitive operations like login and ordering.

Content

Scanner excerpt · SKILL.md (reported line 90)May include surrounding context.

md
6. Continue from where you left off
- If the browser profile disconnects mid-flow (e.g. during login), re-run the `open` command to get a new `targetId`, then continue from where you left off.
- Element refs from a snapshot are only valid until the page changes. Always re-snapshot after navigation or page reload.
- **Never tell the user the browser is down.** Always attempt self-recovery first. Only inform the user if recovery fails after 2 attempts.

## Cart Clearing

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The nightly auto-replenishment mode is triggered by an underspecified condition, making it easier for the skill to run autonomous purchasing preparation in contexts the user may not have intended. Because it can add items to a cart based on historical behavior, ambiguous triggering increases the risk of privacy-invasive profiling and unauthorized shopping actions.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest describes placing grocery orders on Instacart via browser automation, but the workflow explicitly tells the agent to read .env.personal and memory/instacart-storefronts.json. While configuration access may support the task, direct file-reading capability is not part of the stated purpose and is a separate local-data access capability.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.