Back to skill

Security audit

http-retry

Security checks for vulnerabilities and agentic risk

Overview

This is a small HTTP retry helper skill with no install-time execution or persistence, but its sample retry code should be used carefully for state-changing requests.

Installing this skill is reasonable if you want HTTP retry guidance, but treat the code as a starting point. Before using it in production, restrict automatic retries to safe or explicitly idempotent operations, clean up timers in a finally block, cap backoff delays, and define what happens on the final failed attempt.

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 (3)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:15
Finding

Automatic retries can duplicate non-idempotent operations

Content
View full analysis
controller.abort(), timeout); const response = await fetch(url, { ...options, signal: controller.signal }); clearTimeout(timeoutId); if (response.status === 429 || response.status >= 500) { await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt))); continue; } return response; } catch (err) { if (attempt === maxRetries) throw err; await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt))); } } ``` ### Technical Analysis The helper retries requests solely according to network errors and response status. It does not examine the HTTP method or require an idempotency mechanism. Consequently, requests using methods such as `POST` or `PATCH` are retried in the same manner as safe or idempotent requests. A server can successfully commit a state-changing operation and then return a 5xx response, or the connection can fail before the client receives confirmation. The helper interprets either condition as a failed operation and sends the request again. Because the original operation may already have succeeded, the retry can repeat its side effects. ### Attack Path 1. A caller uses `fetchWithRetry` for a state-changing request, such as a payment, message submission, or account update. 2. The destination processes and commits the request. 3. An unstable or attacker-influenced endpoint or intermediary resets the connection or causes a 5xx response after processing. 4. The helper automatically submits the same request again. 5. If the server does not independently deduplicate requests, the state-changing operation is performed multiple ti ...[truncated 349 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:17
Finding

Rejected requests leave timeout handles active

Content
View full analysis
controller.abort(), timeout); const response = await fetch(url, { ...options, signal: controller.signal }); clearTimeout(timeoutId); if (response.status === 429 || response.status >= 500) { await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt))); continue; } return response; } catch (err) { if (attempt === maxRetries) throw err; await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt))); } ``` ### Technical Analysis `clearTimeout(timeoutId)` executes only when `fetch` resolves. If `fetch` rejects before the configured timeout, control transfers directly to the `catch` block and the timeout remains scheduled until it expires. Under frequent request failures, multiple pending timers and their associated closures and controllers can accumulate. The default timeout is 30 seconds, creating a window in which repeated invocations retain avoidable resources. ### Attack Path 1. An application repeatedly invokes the helper against an unreachable or attacker-controlled endpoint. 2. The endpoint causes requests to reject quickly, such as through immediate connection resets or refusals. 3. Each failed attempt leaves its timeout callback active until the full timeout period expires. 4. Sustained failures accumulate pending timers and retained objects. 5. The resulting event-loop and memory pressure can degrade application availability. ### Impact Assessment No additional privileges are obtained. The impact is limited to availability and resource consumption in the process running the helper. Severity depends on request volume, timeout duration, retry count, and whether an attacker can influence the destination or trigger repeated requests. ]]>
Remediation
View remediation
controller.abort(), timeout); try { return await fetch(url, { ...options, signal: controller.signal }); } finally { clearTimeout(timeoutId); } ``` Additionally: - Validate and cap the configured timeout and retry count. - Apply concurrency and request-rate limits where untrusted users can trigger requests. - Consider unreferencing long-running Node.js timers when appropriate so abandoned timers do not unnecessarily keep the process alive. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:15
Finding

Final retryable response is discarded after unnecessary backoff

Content
View full analysis
controller.abort(), timeout); const response = await fetch(url, { ...options, signal: controller.signal }); clearTimeout(timeoutId); if (response.status === 429 || response.status >= 500) { await new Promise(r => setTimeout(r, retryDelay * Math.pow(2, attempt))); continue; } ``` ### Technical Analysis The loop includes attempts from zero through `maxRetries`. When the final attempt receives HTTP 429 or a 5xx response, the implementation still waits for exponential backoff and executes `continue`. The loop then terminates without returning the response or throwing an error, so the asynchronous function resolves to `undefined`. This violates the expected response contract and introduces an unnecessary final delay. A caller that expects a `Response` object may subsequently throw an exception or incorrectly interpret the outcome. ### Attack Path 1. A caller invokes the helper against an endpoint that consistently returns HTTP 429 or a 5xx status. 2. Every response enters the retry branch. 3. On the final permitted attempt, the helper still performs exponential backoff. 4. After the delay, the loop exits without returning or throwing. 5. The caller receives `undefined` and may fail when accessing response properties, creating avoidable service disruption. ### Impact Assessment This issue does not provide elevated privileges or direct data access. Its impact is application-level availability and correctness. A remote endpoint capable of consistently returning retryable status codes can increase latency and trigger downstream exceptions or erroneous control flow. ]]>
Remediation
View remediation
= 500) { if (attempt === maxRetries) { return response; } await new Promise(resolve => setTimeout(resolve, retryDelay * Math.pow(2, attempt)) ); continue; } ``` ]]>
Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (2)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger list contains very broad and generic terms such as "retry", "429", and "http error", which can match many unrelated user requests and cause this skill to activate outside its intended scope. Over-broad activation can lead to inappropriate guidance being injected into unrelated workflows, reducing reliability and potentially interfering with safer or more relevant skills.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill’s natural-language instructions and headings are presented entirely in Chinese, but the file does not indicate that the language is optional or that the skill is intended only for a Chinese-language environment. This can violate language or locale policy when users are not given an explicit choice.

Content

No source excerpt is available for this finding.