Back to skill

Security audit

Recursive Find

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent recursive website search skill, but its crawler can follow redirects outside the intended site boundary and may reach internal network services.

Review this before installing if you may run it against untrusted URLs. It should be used only for sites you intentionally want the agent host to contact, and it would be safer if redirects were manually validated and private, loopback, link-local, and other internal network targets were blocked.

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
scripts/crawl.mjs:109
Finding

Automatic Redirects Bypass Origin Restrictions and Permit SSRF

Content
View full analysis

Vulnerability Details

File Location: scripts/crawl.mjs:109-124, scripts/crawl.mjs:327-333, scripts/crawl.mjs:390-418
Vulnerability Type: Server-Side Request Forgery through unvalidated redirects
Risk Level: Medium

Complete Code Snippet

js
export async function fetchPage(url, timeoutMs, { signal, maxBodyBytes = MAX_BODY_BYTES, pauses } = {}) {
  const origin = new URL(url).origin;
  for (let attempt = 0; ; attempt++) {
    const wait = (pauses?.get(origin) ?? 0) - Date.now();
    if (wait > 0) await sleep(wait, signal);
    const controller = new AbortController();
    const timer = setTimeout(() => controller.abort(), timeoutMs);
    const onAbort = () => controller.abort();
    if (signal?.aborted) controller.abort();
    else signal?.addEventListener("abort", onAbort, { once: true });
    try {
      const res = await fetch(url, {
        signal: controller.signal,
        redirect: "follow",
        headers: { "user-agent": UA, accept: "text/html,application/xhtml+xml,text/plain;q=0.9" },
      });
js
const allowed = (href) => {
  try {
    const u = new URL(href);
    if (!opts.anySite && !origins.has(u.origin)) return false;
    if (opts.within && !u.pathname.startsWith(opts.within)) return false;
    return true;
  } catch {
    return false;
  }
};
js
const visit = async ({ url, depth }) => {
  try {
    if (opts.robots) {
      const rules = await robotsFor(new URL(url).origin);
      if (!robotsAllows(rules, url)) {
        blocked++;
        return;
      }
    }
    const { bytes, contentType, finalUrl, truncated } = await fetchPage(url, timeoutMs, fetchOpts);
    if (truncated) truncatedPages.push(finalUrl);
    if (stopped) return;
    // Two links that redirect to the same page: search it once.
    const finalKey = normalizeUrl(finalUrl);
    if (fetched.has(finalKey)) return;
    fetched.add(finalKey);
    visited.add(finalKey);
    if (depth === 0) {
      try { origins.add(new URL(finalUrl).origin); 
...[truncated 3555 chars]
Remediation
View remediation

Remediation Suggestions

  1. Set redirect: "manual" and process redirects explicitly.
  2. Before every request and every redirect hop:
    • Resolve the destination hostname.
    • Reject loopback, private, link-local, multicast, unspecified, and reserved IPv4 and IPv6 ranges.
    • Validate every returned DNS address rather than only the hostname string.
    • Revalidate the protocol, port, origin, and --within restriction.
  3. Apply the same-origin policy to each redirect destination, not only to the original link.
  4. Do not add a redirected final origin to origins unless it independently passes the complete destination policy and is consistent with the user's authorized target.
  5. Limit the number of redirect hops and reject redirect loops.
  6. Mitigate DNS rebinding by binding validation to the address actually used for the connection, or by using a network layer that resolves, validates, and connects to the validated address atomically.
  7. Consider denying redirects to nonstandard ports unless the user explicitly authorizes them.
  8. Add regression tests covering:
    • Public-to-loopback redirects.
    • Public-to-private IPv4 and IPv6 redirects.
    • Redirect chains where only a later hop enters a restricted range.
    • DNS names that resolve to mixed public and private addresses.
    • Start-page redirects that would otherwise add an internal origin to origins.
Vulnerability Patterns
  • System Prompt LeakageDirect Leakage, Indirect Extraction, Tool-Based Exfiltration
  • 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 (1)

Direct Prompt Extraction

High
Category
System Prompt Leakage
Confidence
85% confidence
Finding

Skill contains instructions that could directly expose system prompts, internal rules, or hidden instructions to users or external parties.

Content

Scanner excerpt · scripts/crawl.mjs (reported line 215)May include surrounding context.

js
}
    }
  }
  return rules;
}

// Does a robots.txt path pattern match? "*" is any run of characters and a

Static analysis

No suspicious patterns detected.