Back to skill

Security audit

Diffgate

Security checks for vulnerabilities and agentic risk

Overview

DiffGate is a local text-comparison skill whose behavior matches its stated purpose, with ordinary caution needed around local service exposure and dependency pinning.

Install only in an environment where resolving current PyPI packages is acceptable, and keep the Uvicorn service bound to localhost unless you add authentication, rate limits, and resource controls. Avoid submitting secrets unless you are comfortable with the local service process handling that text.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
diffgate/app.py:20
Finding

Unauthenticated CPU and Memory Denial of Service Through Expensive Text Comparison

Content
View full analysis
DiffResponse: """Compare two texts and return diff with similarity score.""" lines_a = request.text_a.splitlines(keepends=True) lines_b = request.text_b.splitlines(keepends=True) # Compute similarity using SequenceMatcher matcher = difflib.SequenceMatcher(None, lines_a, lines_b) ratio = matcher.ratio() ``` ### Technical Analysis The `/v1/diff` endpoint accepts two strings of up to 500,000 characters each without authentication, rate limiting, request quotas, or execution time limits. It then creates multiple in-memory line arrays and performs `difflib.SequenceMatcher` processing synchronously. Although the route is declared with `async def`, the comparison is CPU-bound and contains no asynchronous yield while it runs. Consequently, each expensive comparison can block the application worker's event loop. Carefully structured inputs with many repetitive or reordered lines can increase comparison cost. The subsequent unified-diff generation also consumes additional CPU and memory and may produce a large response. The input length bounds reduce unlimited growth but remain large enough for repeated or concurrent requests to exhaust application resources. ### Attack Path 1. An attacker obtains network access to the Uvicorn service. 2. The attacker repeatedly sends `POST /v1/diff` requests containing two near-maximum-length texts. 3. The texts are structur ...[truncated 747 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:4
Finding

Unpinned Third-Party Runtime Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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 (1)

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 20)May include surrounding context.

Compare texts

bash
curl -s -X POST http://localhost:8006/v1/diff \
  -H "Content-Type: application/json" \
  -d '{"text_a": "hello\nworld", "text_b": "hello\nearth"}' | jq