Back to skill

Security audit

Haresh Product Search

Security checks for vulnerabilities and agentic risk

Overview

This product-search skill is not clearly malicious, but it needs Review because its code sends search queries to an undocumented external placeholder instead of the documented local n8n endpoint.

Review before installing. Only use this skill if you control the webhook destination and update the code or documentation so the endpoint is explicit and correct. Avoid entering sensitive product queries until the endpoint, payload minimization, response validation, timeout handling, and user disclosure are fixed.

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

Warning
Location
index.js:2
Finding
Undisclosed External Transmission of User Search Queries## Vulnerability Details **File Location**: `index.js:2-6` **Vulnerability Type**: Hard-coded external endpoint and behavior-documentation mismatch **Risk Level**: Medium ### Vulnerable Code ```js const response = await fetch("https://your-n8n-webhook-url", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ query }) }); ``` The runtime behavior conflicts with the endpoint documented at `SKILL.md:20`: ```md 3. Use exec tool to POST to n8n webhook at http://localhost:5678/webhook/product-search ``` ### Technical Analysis The implementation serializes the complete user-controlled `query` and transmits it to the hard-coded HTTPS host `your-n8n-webhook-url`. This differs from the documented behavior, which states that requests are sent to a service on `localhost`. Consequently, users and operators may reasonably expect product-search information to remain within the local environment while the implementation attempts to send it to an external destination. If this hostname is replaced with or resolves to an attacker-controlled service during deployment, that service can collect every query submitted through the skill. The endpoint is not loaded from a validated configuration source, constrained by an allowlist, or disclosed accurately in the skill documentation. The implementation also does not inspect or minimize potentially sensitive information contained in a query before transmission. This finding does not establish remote code execution, credential theft, or deliberate malicious behavior. The exposed scope is limited to data supplied in the `query` parameter. ### Attack Path 1. An operator deploys the skill while relying on the documentation indicating that requests use a localhost webhook. 2. The hard-coded hostname is made resolvable or replaced with an endpoint controlled by an untrusted party. 3. A user invokes `search_products` with a product query that in ...[truncated 1086 chars]
Remediation
## Remediation Suggestions 1. Replace the hard-coded placeholder with the intended local endpoint or an explicitly supplied deployment configuration: ```js const endpoint = process.env.PRODUCT_SEARCH_WEBHOOK_URL; if (!endpoint) { throw new Error("PRODUCT_SEARCH_WEBHOOK_URL is not configured"); } ``` 2. Validate the configured URL before use. Restrict its protocol, hostname, and port to an approved allowlist. If the service is intended to remain local, accept only loopback hosts such as `127.0.0.1` or `localhost`. 3. Keep the implementation and `SKILL.md` consistent. Clearly disclose when queries are transmitted to a third-party or remotely operated service. 4. Obtain appropriate user confirmation before sending queries externally, particularly when they may contain personal or confidential information. 5. Minimize transmitted data and reject or redact fields that are unnecessary for product search. 6. Define and validate the webhook response against a strict schema before returning it to the agent or presenting it to a user. 7. Apply request timeouts, response-size limits, and controlled error handling to reduce availability and resource-exhaustion risks. 8. Add automated tests that verify the destination against the documented endpoint policy and fail deployment when a placeholder hostname remains configured.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Hidden Instructions

High
Category
Prompt Injection
Content
---
name: haresh-product-search
description: "Search e-commerce products via n8n webhook integration"
user-invocable: true
Confidence
60% confidence
Finding
Hidden instructions were detected in comments or invisible text. These could contain malicious directives. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
exports.search_products = async function ({ query }) {
  const response = await fetch("https://your-n8n-webhook-url", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ query })
Confidence
91% confidence
Finding
This code performs a direct POST request to an external URL and includes raw user input in the request body. While external calls can be legitimate, this is security-relevant because it creates an exfiltration path for potentially sensitive prompts or user-entered data, especially if the webhook is third-party managed or insufficiently governed.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The function sends the user-provided query to an external webhook, which is an external data transmission point with no visible disclosure, consent, minimization, or restriction on what may be sent. In an agent skill context, users may provide sensitive data in queries, so forwarding it to a third-party endpoint can create privacy, compliance, and data-handling risks.

Static analysis

No suspicious patterns detected.