Back to skill

Security audit

Crash Fixer

Security checks for vulnerabilities and agentic risk

Overview

This skill is an autonomous crash fixer, but it sends sensitive crash and code data to an external AI provider and can create repository changes from unvalidated model output.

Review carefully before installing. Use only with a least-privilege GitHub token on a repository where external AI processing of crash data and source snippets is acceptable. Avoid non-dry-run mode unless branch and PR creation from AI-generated code is explicitly intended, and note that the current dry-run still mutates crash-reporter state.

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

Error
Location
index.js:115
Finding
Sensitive crash data and proprietary source code are transmitted to an external AI service<![CDATA[ ## Vulnerability Details **File Location**: `index.js`, lines 115–151 **Vulnerability Type**: Excessive external disclosure of sensitive information **Risk Level**: High ### Vulnerable Code ```js const prompt = `You are an expert iOS Swift developer. Analyze this crash and fix it. ## Crash Information - **Error Name:** ${errorName} - **Message:** ${message} - **Platform:** ${crash.platform} - **App Version:** ${crash.app_version} - **User ID:** ${crash.user_id || "(anonymous)"} - **Device:** ${crash.device_info || "unknown"} ## Stack Trace \`\`\` ${stackTrace} \`\`\` ## Code from Repository ${codeContext || "No relevant code found"} ## Your Task 1. Analyze the stack trace to find the root cause 2. Search the codebase for relevant files 3. Identify the exact fix needed 4. Write the complete fixed code ## Response Format Respond with ONLY JSON: { "root_cause": "2-3 sentence explanation", "file_path": "full path to file that needs fixing", "fix_code": "complete replacement code", "search_terms": ["term1", "term2"] } If you cannot fix: {"cannot_fix": true, "reason": "why"}`; console.log(`[crash-fixer] Analyzing with MiniMax M2.5...`); const res = await fetch("https://api.minimax.chat/v1/text/chatcompletion_v2", { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${process.env.ZAI_API_KEY}` }, body: JSON.stringify({ model: "MiniMax-M2.5", messages: [{ role: "user", content: prompt }], temperature: 0.2, max_tokens: 8000 }) }); ``` ### Technical Analysis The prompt sent to MiniMax contains crash messages, a user identifier, device information, stack traces, application metadata, and repository source code. Crash reports commonly contain personal data, authentication material, internal paths, memory values, and application state. Repository excerpts may contain proprietary implementation details or accidentally committed secrets. Some external AI analysis is consisten ...[truncated 1808 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove `user_id` and detailed device identifiers from the model prompt unless they are demonstrably required for a specific diagnosis. 2. Redact credentials, access tokens, email addresses, IP addresses, file-system paths, and other personal or secret data from all crash fields. 3. Scan source excerpts for secrets before transmission and send only the smallest relevant functions or line ranges. 4. Require explicit operator approval before transmitting crash data or private source code to an external provider. 5. Provide a configurable trusted endpoint or local-model option for organizations that cannot disclose source code externally. 6. Document the exact AI provider, transmitted fields, retention expectations, and applicable privacy controls in `SKILL.md`. 7. Validate that the destination uses HTTPS and apply an allowlist rather than permitting arbitrary model endpoints. 8. Add audit logging that records the categories and volume of data transmitted without recording the sensitive content itself. 9. Align the declared environment requirements with the implementation, including the currently used `ZAI_API_KEY`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
index.js:261
Finding
Untrusted AI output can replace arbitrary repository files and create malicious pull requests<![CDATA[ ## Vulnerability Details **File Location**: `index.js`, lines 158–163 and 261–346 **Vulnerability Type**: Unvalidated model-generated repository modification **Risk Level**: High ### Vulnerable Code The AI response is parsed and trusted as a fix specification: ```js try { const jsonMatch = content.match(/\{[\s\S]*\}/); if (jsonMatch) { return JSON.parse(jsonMatch[0]); } return { cannot_fix: true, reason: "Could not parse AI response" }; } catch (e) { return { cannot_fix: true, reason: `Parse error: ${e.message}` }; } ``` The returned path and replacement content are then used directly: ```js async function createFixPR(crash, fix) { const branchName = `fix/crash-${crash.id}-${fix.file_path?.split('/')?.pop()?.replace('.swift', '') || 'unknown'}`.substring(0, 50); const commitMsg = `fix: ${crash.error_name} - ${fix.root_cause?.substring(0, 50) || 'crash fix'}`; // Get default branch const repoRes = await fetch(`https://api.github.com/repos/${TARGET_REPO}`, { headers: { "Authorization": `Bearer ${GH_TOKEN}` } }); const repo = await repoRes.json(); const baseBranch = repo.default_branch; // Get base branch SHA const refRes = await fetch(`https://api.github.com/repos/${TARGET_REPO}/git/ref/heads/${baseBranch}`, { headers: { "Authorization": `Bearer ${GH_TOKEN}` } }); const refData = await refRes.json(); const baseSha = refData.object.sha; // Create branch console.log(`[crash-fixer] Creating branch: ${branchName}`); await fetch(`https://api.github.com/repos/${TARGET_REPO}/git/refs`, { method: "POST", headers: { "Authorization": `Bearer ${GH_TOKEN}`, "Content-Type": "application/json" }, body: JSON.stringify({ ref: `refs/heads/${branchName}`, sha: baseSha }) }); // Get file content let existingContent = ""; let sha = null; try { const fileRes = await fetch(`https://api.github.com/repos/${TARGET_REPO}/contents/${fix.file_path}?ref=${branchNam ...[truncated 4556 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Treat every model response as untrusted input. 2. Build an allowlist of existing Swift files identified before model inference, and reject any returned path outside that list. 3. Normalize paths and reject absolute paths, traversal components, encoded separators, control characters, and sensitive directories. 4. Explicitly prohibit modifications to `.github/workflows`, build scripts, dependency manifests, signing configuration, secrets, and deployment files. 5. Require the target file to exist; do not permit the model to create arbitrary files. 6. Generate and inspect a bounded patch rather than accepting complete replacement files. 7. Enforce limits on changed lines, file size, and number of files. 8. Parse or compile generated Swift code and run project tests, linting, secret scanning, and static security analysis. 9. Display the proposed diff and require explicit human approval before creating a commit or pull request. 10. Apply strict branch protections and prohibit automatic merging of AI-generated pull requests. 11. Use a fine-grained GitHub token limited to the single target repository and only the minimum contents and pull-request permissions. 12. Separate analysis from write operations so the default mode cannot modify a repository. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
index.js:382
Finding
Dry-run mode modifies crash-reporter state<![CDATA[ ## Vulnerability Details **File Location**: `index.js`, lines 382–402 **Vulnerability Type**: Unexpected remote state mutation **Risk Level**: Medium ### Vulnerable Code ```js const alreadyFixed = await isAlreadyFixed(crash); if (alreadyFixed) { console.log(`[crash-fixer] Skipping #${crash.id} - already fixed previously`); skipped++; continue; } await markFixing(crash.id, "Processing..."); const fix = await analyzeCrash(crash); if (fix.cannot_fix) { console.log(`[crash-fixer] Cannot fix #${crash.id}: ${fix.reason}`); await markFixing(crash.id, `Cannot fix: ${fix.reason}`); skipped++; continue; } console.log(`[crash-fixer] Root cause: ${fix.root_cause?.substring(0, 100)}...`); console.log(`[crash-fixer] File: ${fix.file_path}`); if (dryRun) { console.log(`[crash-fixer] DRY-RUN: Would fix ${fix.file_path}`); processed++; continue; } ``` ### Technical Analysis The Skill calls `markFixing()` before checking `dryRun`. That function performs an authenticated `PATCH` request and changes the crash status to `fixing`. If analysis fails, another authenticated update writes failure details even during a dry run. Operators generally expect a dry-run option to avoid persistent changes. The documented option says it analyzes without creating pull requests, but the name and conventional semantics still imply a non-mutating preview. The current ordering can leave crash records in a state that affects future processing and deduplication. ### Attack Path 1. An operator invokes `/crash-fixer --dry-run` to preview crash analysis. 2. The Skill retrieves a new crash and determines it has not already been fixed. 3. Before evaluating the dry-run condition, it calls `markFixing(crash.id, "Processing...")`. 4. The crash reporter persistently changes the record status to `fixing`. 5. A later run sees that status during duplicate checks and may treat the record as already being addressed. 6. The crash can consequently be skipped or remain in a misl ...[truncated 598 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Check `dryRun` before every state-changing crash-reporter or GitHub request. 2. In dry-run mode, perform only read operations and local analysis. 3. Refactor remote writes behind a single function that refuses mutation whenever `dryRun` is enabled. 4. Add tests asserting that dry-run execution produces no `PATCH`, `POST`, `PUT`, or `DELETE` requests. 5. If status updates during analysis are intentionally required, replace `--dry-run` with a more precise option name and clearly document that it still mutates crash records. 6. Consider returning the proposed status changes as local output so operators can inspect them without applying them. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The skill description says it analyzes with Codex 5.3 High and monitors Cloudflare D1 crash reports, but the content also states it uses MiniMax and a generic CRASH_REPORTER_URL endpoint, creating a material mismatch between declared and actual behavior. This is dangerous because operators may approve the skill based on an inaccurate trust model while it sends sensitive crash data to a different AI provider and reaches arbitrary remote infrastructure specified by environment variables.

Missing User Warnings

High
Confidence
99% confidence
Finding
The code sends stack traces, messages, user identifiers, device data, app version, and repository code context to an external AI API without any confirmation, minimization, or redaction. In this skill context, crash reports often contain sensitive internal code paths and possible personal or operational data, so silent third-party transmission creates substantial confidentiality and compliance risk.

Lp3

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding
The skill declares no explicit tool scope despite requiring environment variables and network access, which obscures the real privilege boundary of an autonomous workflow that can contact external services and act on a repository. In this context, missing scope is dangerous because the skill fetches crash data, uses external AI analysis, and can create branches and pull requests, so reviewers and runtime policy engines lack a clear least-privilege contract.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill can autonomously generate code changes and create pull requests, but the description does not prominently warn users that non-dry-run mode performs write actions against a target repository. In this context, the omission increases risk because users may invoke the skill expecting analysis only, while it can produce externally proposed code changes based on crash data and AI-generated fixes.

Description-Behavior Mismatch

Medium
Confidence
96% confidence
Finding
The skill metadata and implementation materially differ: the manifest says crash reports come from Cloudflare D1, but the code accepts an arbitrary CRASH_REPORTER_URL and trusts that endpoint for input and workflow state. This weakens operator understanding and review, and can cause sensitive crash data to be pulled from or sent to an unexpected service under false assumptions.

Description-Behavior Mismatch

Medium
Confidence
99% confidence
Finding
The manifest claims analysis is done with Codex 5.3 High, but the code actually transmits crash details and repository code to MiniMax. This is dangerous because users may approve the skill based on one model/vendor's security and data-handling expectations while the implementation silently exfiltrates sensitive data to a different third party.

External Transmission

Medium
Category
Data Exfiltration
Content
console.log(`[crash-fixer] Analyzing with MiniMax M2.5...`);
  
  const res = await fetch("https://api.minimax.chat/v1/text/chatcompletion_v2", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
Confidence
98% confidence
Finding
This call transmits crash contents and repository code context to api.minimax.chat, an external third party. Given the skill's purpose, the transmitted data may include sensitive stack traces, internal source code, and user-related metadata, making the external transmission itself security-relevant rather than a benign network operation.

External Transmission

Medium
Category
Data Exfiltration
Content
console.log(`[crash-fixer] Analyzing with MiniMax M2.5...`);
  
  const res = await fetch("https://api.minimax.chat/v1/text/chatcompletion_v2", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
Confidence
98% confidence
Finding
This call transmits crash contents and repository code context to api.minimax.chat, an external third party. Given the skill's purpose, the transmitted data may include sensitive stack traces, internal source code, and user-related metadata, making the external transmission itself security-relevant rather than a benign network operation.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const res = await fetch(
      `https://api.github.com/search/code?q=${encodeURIComponent(query)}&per_page=3`,
      {
        headers: {
          "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const res = await fetch(
      `https://api.github.com/search/code?q=${encodeURIComponent(query)}&per_page=3`,
      {
        headers: {
          "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const res = await fetch(
      `https://api.github.com/search/code?q=${encodeURIComponent(query)}&per_page=3`,
      {
        headers: {
          "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
try {
    const res = await fetch(
      `https://api.github.com/search/code?q=${encodeURIComponent(query)}&per_page=3`,
      {
        headers: {
          "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill autonomously creates branches, commits generated code, and opens pull requests without human approval. Because the change content is derived from untrusted crash input and an external model response, this can introduce malicious or unsafe code into the repository and abuses the granted GitHub token if the workflow is triggered unexpectedly.

External Transmission

Medium
Category
Data Exfiltration
Content
// Create branch
  console.log(`[crash-fixer] Creating branch: ${branchName}`);
  await fetch(`https://api.github.com/repos/${TARGET_REPO}/git/refs`, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
94% confidence
Finding
This creates a new Git reference in the target repository automatically using the configured token. In context, this is part of an autonomous write pipeline driven by untrusted crash data and external model output, so it enables unauthorized or unsafe repository changes if the skill is misused or the input is manipulated.

External Transmission

Medium
Category
Data Exfiltration
Content
// Commit the change
  console.log(`[crash-fixer] Committing fix to ${fix.file_path}`);
  
  const commitRes = await fetch(`https://api.github.com/repos/${TARGET_REPO}/contents/${fix.file_path}`, {
    method: "PUT",
    headers: {
      "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
97% confidence
Finding
This endpoint writes model-generated content into the repository without human review. Since fix.file_path and fix.fix_code originate from an external AI response influenced by crash input, an attacker could potentially steer changes into sensitive files or inject harmful code, making this a direct integrity risk.

External Transmission

Medium
Category
Data Exfiltration
Content
// Create PR
  console.log(`[crash-fixer] Creating PR...`);
  
  const prRes = await fetch(`https://api.github.com/repos/${TARGET_REPO}/pulls`, {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${GH_TOKEN}`,
Confidence
91% confidence
Finding
Automatically opening a pull request publicizes and operationalizes unreviewed, model-generated code changes. While less severe than direct code writes, it can still leak sensitive crash details in the PR body and create social-engineering pressure to merge unsafe changes.

Intent-Code Divergence

Low
Confidence
92% confidence
Finding
The comment and implementation at the top of the file clearly indicate MiniMax is the active model, while the PR body fallback text later states 'Analyzed via Codex 5.3 High'. These statements contradict each other about which AI system performed the analysis.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
index.js:17