T09 · Insecure Skill Coding Practices
- Location
index.js:2- Finding
Undisclosed External Transmission of User Search Queries
- Content
View full analysis
Vulnerability Details
File Location:
index.js:2-6
Vulnerability Type: Hard-coded external endpoint and behavior-documentation mismatch
Risk Level: MediumVulnerable 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-searchTechnical Analysis
The implementation serializes the complete user-controlled
queryand transmits it to the hard-coded HTTPS hostyour-n8n-webhook-url. This differs from the documented behavior, which states that requests are sent to a service onlocalhost.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
queryparameter.Attack Path
- An operator deploys the skill while relying on the documentation indicating that requests use a localhost webhook.
- The hard-coded hostname is made resolvable or replaced with an endpoint controlled by an untrusted party.
- A user invokes
search_productswith a product query that in ...[truncated 1086 chars]
- Remediation
View remediation
Remediation Suggestions
- 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"); } - 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.1orlocalhost. - Keep the implementation and
SKILL.mdconsistent. Clearly disclose when queries are transmitted to a third-party or remotely operated service. - Obtain appropriate user confirmation before sending queries externally, particularly when they may contain personal or confidential information.
- Minimize transmitted data and reject or redact fields that are unnecessary for product search.
- Define and validate the webhook response against a strict schema before returning it to the agent or presenting it to a user.
- Apply request timeouts, response-size limits, and controlled error handling to reduce availability and resource-exhaustion risks.
- Add automated tests that verify the destination against the documented endpoint policy and fail deployment when a placeholder hostname remains configured.
- Replace the hard-coded placeholder with the intended local endpoint or an explicitly supplied deployment configuration:
