Back to skill

Security audit

bug-fixing

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent bug-fixing workflow, but it asks for persistent self-updates and includes diagnostic/restart guidance that needs user review before installation.

Install only if you are comfortable with a bug-fixing skill that can edit code, run verification commands, update persistent bug-history files, and potentially change its own instructions. Require explicit approval before service restarts, cache deletion, or any skill/reference-file updates, and ensure diagnostic logging redacts secrets, cookies, tokens, personal data, session identifiers, and internal URLs.

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
references/system-rca.md:45
Finding

Unredacted Diagnostic Payload Logging and Session Identifier Disclosure

Content
View full analysis

Vulnerability Details

File Location: references/system-rca.md:45-52
Vulnerability Type: Sensitive data exposure through insecure diagnostic guidance
Risk Level: Medium

Vulnerable Code Snippet

markdown
### Step 3: Insert Probes

BEFORE modifying any behavior, insert probes to collect evidence:

| Probe Type | Location | What to Log |
|-----------|----------|-------------|
| Log | Each edge | `[EdgeN] from=X to=Y payload={...}` |
| Return field | Tool result | `{ ..., debug: { sessionId, url } }` |
| Metric | Critical path | Latency, success rate |
| Assertion | Invariant points | `assert(sessionId != null)` |

Technical Analysis

The system-level debugging procedure directs the agent to log payloads at every cross-layer edge and return sessionId and url values in tool results. It does not require field allowlisting, sensitive-value redaction, development-only gating, access restrictions, retention limits, or removal of probes after diagnosis.

Cross-layer payloads may contain authorization headers, cookies, API tokens, credentials, personal information, prompts, message contents, or confidential business records. Session identifiers may be authentication-adjacent secrets or provide useful correlation data. Internal URLs may disclose network topology, endpoint names, query parameters, or embedded credentials.

Although another reference recommends redacting sensitive logs generally, this specific mandatory diagnostic example presents unrestricted payload logging and explicit session disclosure without connecting those safeguards to the procedure. Full payload capture and client-visible session identifiers exceed the minimum information normally necessary for root-cause analysis.

Attack Path

  1. An attacker submits crafted content through an affected API, browser session, streaming connection, or tool invocation.
  2. A developer or agent follows the Skill's system-level RCA procedure and inserts the recommended probes.

...[truncated 1444 chars]

Remediation
View remediation

Remediation Suggestions

  1. Replace complete-payload logging with an explicit allowlist of non-sensitive diagnostic fields, such as event type, payload size, status, latency, and a generated correlation ID.
  2. Redact or omit authorization headers, cookies, session identifiers, API keys, passwords, private keys, personal information, message bodies, and URL query strings.
  3. Generate a random diagnostic correlation ID that is distinct from authentication and application session identifiers.
  4. Never return session identifiers to clients or include them in tool-visible debug fields.
  5. Sanitize URLs by removing user information, query parameters, fragments, and internal host details unless strictly required.
  6. Gate diagnostic probes behind a development-only or time-limited feature flag that is disabled by default in staging and production.
  7. Apply least-privilege access controls and short retention periods to diagnostic logs.
  8. Require probes to be removed or disabled immediately after evidence collection.
  9. Add automated tests verifying that sensitive field names and representative secret values do not appear in logs or tool responses.
  10. Revise the example to use a safe pattern such as:
markdown
| Log | Each edge | `[EdgeN] from=X to=Y correlationId={id} eventType={type} payloadBytes={size}` |
| Return field | Internal diagnostic result only | `{ debug: { correlationId, status } }` |
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Self-Modification

High
Category
Rogue Agent
Confidence
90% confidence
Finding

The skill explicitly instructs updating the skill itself based on future review outcomes, which is a self-modification pattern. In a system where skills can write files and influence future executions, this can enable persistent prompt drift, accidental weakening of safeguards, or insertion of insecure instructions that survive beyond the current task.

Content

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

md
## Skill Evolution

Update this skill when:
- Code review finds a bug that the workflow should have prevented
- A recurring bug class repeats across fixes

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/frontend-patterns.md (reported line 40)May include surrounding context.

md
- **Symptom**: Console warning about setState on unmounted component; state issues on route change
- **Detection**: setState called in async callback after component unmounts
- **Fix**: Use AbortController for fetch; unsubscribe in cleanup; keep-only-latest pattern with requestId
- **Verify**: Rapidly switching routes produces no warnings; data not overwritten

### 1.5 Controlled/Uncontrolled Input Switch

Anti-Refusal Statement

High
Category
Anti-Refusal
Confidence
80% confidence
Finding

Skill instructs the agent to omit warnings, disclaimers, or ethical commentary. Stripping safety caveats hides risk from the user and is a common jailbreak preamble.

Content

Scanner excerpt · references/frontend-patterns.md (reported line 47)May include surrounding context.

md
- **Symptom**: Input value jumps; console warns about controlled/uncontrolled switch
- **Detection**: value changes from undefined to string (or vice versa)
- **Fix**: Ensure input is always controlled (default empty string) or always uncontrolled
- **Verify**: First render/async load/reset flows without warnings

### 1.6 Unstable Key Causes List Reuse Errors

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The manifest sets language: en, which is a natural-language locale constraint. The file does not indicate that users can opt into another language or that English-only behavior is required for a documented region-specific or compliance reason.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill includes concrete commands to forcibly terminate Python processes, recursively delete __pycache__ directories, and restart services, but it does so without requiring explicit user confirmation, environment scoping, or safety checks. In an agentic context with execute privileges, this can cause unintended service interruption, loss of unsaved work, or impact to the wrong process if matching is too broad.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
75% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/bug-patterns.md (reported line 164)May include surrounding context.

md
## High-Frequency Root Causes (Top 18)

1. **Unverified assumptions** — assuming API/feature works without checking docs
2. **Incomplete status check** — only checking HTTP status, not business status
3. **Missing edge case handling** — not considering empty/null/boundary input
4. **Stale closure/state** — capturing old values in callbacks/effects

Static analysis

No suspicious patterns detected.