Back to plugin

Security audit

Jerith Guard

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked jerith-guard suspicious because it found a resource exhaustion weakness that could affect the shared gateway under sustained message traffic.

Consider the risk that sustained admitted message traffic could slow or exhaust the shared gateway. The scanner says the practical impact depends on ingress limits, resources, and the number of identities involved; weigh those controls and your tolerance for service disruption before installing.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

CWE-400

Warning
Location
src/server.ts:62
Finding

Unbounded Sender State and Burst Processing Can Exhaust Gateway Resources ## Remediation Suggestions 1. **Bound sender storage.** Enforce a configurable maximum number of tracked senders and evict inactive entries using TTL and LRU policies. Run cleanup independently of future messages from the same sender. 2. **Replace timestamp-array scans.** Use a fixed-size time-bucket counter or bounded queue. Limit both memory consumption and processing cost per inbound message. 3. **Enforce ingress limits.** Apply per-sender and global rate limits before state updates and logging. Use gateway-level admission controls to address distributed traffic across multiple identities. 4. **Aggregate burst logging.** Record the transition into a burst condition and periodic summaries instead of writing a record for every excess message. 5. **Bound logging overhead.** Use asynchronous buffered writes with a capped queue and an explicit overload policy. Ensure excessive logging cannot block the gateway event loop. 6. **Add adversarial-load tests.** Test concentrated traffic within a 60-second window, many distinct senders, idle-state expiration, and sustained burst logging. Verify bounded state size, queue depth, and processing latency.

Content
View full analysis

Vulnerability Details

File Location: src/server.ts:62–68, 141–148; inbound trigger in src/index.ts:142–164. The corresponding behavior is also present in dist/server.js and dist/index.js.

Vulnerability Type: CWE-400 — Uncontrolled Resource Consumption

Risk Level: Medium

Complete Code Snippet

The inbound hook processes every admitted message and logs repeated burst events:

ts
onMsg("message_received", (event: unknown) => {
  if (!cfg.enabled || !server) return;
  const e = event as {
    content?: string;
    senderId?: string;
    senderIsOwner?: boolean;
    sessionKey?: string;
  };
  if (!e || typeof e.content !== "string") return;
  const senderId = String(e.senderId ?? "unknown");
  const recent = server.recentCount(senderId);
  if (recent > 12 && !(e.senderIsOwner === true)) {
    server.recordVerdict(senderId, "flag", ["spam.burst"]);
    (api.logger.warn ?? api.logger.info).call(
      api.logger,
      `jerith-guard: sender ${server.senderTag(senderId)} burst=${recent}/60s — flagged`
    );
  }
  return undefined;
});

The counter filters and grows an array on every message:

ts
recentCount(senderId: string, now = Date.now()): number {
  const s = this.get(senderId, now);
  s.messageTimestamps = s.messageTimestamps.filter((t) => now - t < this.windowMs);
  s.messageTimestamps.push(now);
  s.lastSeenAt = now;
  return s.messageTimestamps.length;
}

Sender records are created without a capacity limit or eviction:

ts
private get(senderId: string, now = Date.now()): SenderState {
  let s = this.state.get(senderId);
  if (!s) {
    s = { messageTimestamps: [], verdicts: [], threatScore: 0, firstSeenAt: now, lastSeenAt: now, lastVerdictAt: now };
    this.state.set(senderId, s);
  }
  return s;
}

Technical Analysis

Two resource-management weaknesses are reachable through the inbound-message hook:

  1. Unbounded sender retention. Each previously unseen sender creates a map entry. No idle expiration or ...[truncated 2713 chars]

SkillSpector was not run because this plugin release contains no bundled skills.

Endor dependency reachability

Checked Nov 7, 2026 · 7:43 PM UTC

No reachable vulnerabilities reported

Endor dependency scan completed.