Back to skill

Security audit

Code Quality Analyzer (FightingDao)

Security checks for vulnerabilities and agentic risk

Overview

The skill has a legitimate code-quality purpose, but it can overwrite database records and automatically delegate repository review to another model without clear consent or consistent privacy disclosure.

Install only if you are comfortable with the skill analyzing repository history and diffs, writing to the code-quality database, replacing records for selected periods, and possibly using a provider-qualified child model for code review. Require an explicit period confirmation, backup or dry run before sync, and local-only review for confidential repositories.

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

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:546
Finding

External AI Review May Disclose Proprietary Repository Data

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:546-576 and SKILL.md:600-605
Vulnerability Type: Excessive repository access and unapproved third-party data processing
Risk Level: High

Vulnerable Code Snippet

typescript
// In the code review stage, automatically spawn a child task
sessions_spawn({
  model: "bailian/kimi-k2.5",
  task: `Perform a line-by-line review of this week's code changes for the ${projectName} project.

Review scope: ${branchName}
Changed files: ${fileList}
Changed lines: +${insertions}/-${deletions}

Review the following dimensions:
1. Security
2. Performance
3. Correctness
4. Maintainability
5. Testing

Output format:
| File | Line | Issue Type | Severity | Description | Recommendation |
`,
  cwd: projectPath
})

The documented workflow further directs the child task to access repository differences:

text
Main task:
  -> Analyze code changes
  -> Synchronize data to the database
  -> Score
  -> Spawn child task (kimi-k2.5)
        -> Obtain git diff
        -> Review code line by line
        -> Identify issues
        -> Return structured results
  -> Receive review results
  -> Store them in the database

Technical Analysis

The Skill mandates spawning a provider-qualified AI model and grants the spawned task access to projectPath through its working directory. The workflow then instructs that child task to obtain Git diffs and perform a line-by-line review.

A full Git diff can contain proprietary source code, unreleased functionality, credentials accidentally committed to the repository, internal hostnames, security defects, and contributor information. The Skill provides no explicit consent gate, provider disclosure, data-classification check, secret scanning, redaction, file allowlist, or minimization control before the external-model operation.

This also conflicts with the Skill's statements elsewhere that AI scoring and review do not call an external AI API. Consequently, users may rea ...[truncated 2383 chars]

Remediation
View remediation

Remediation Suggestions

  1. Use the current trusted local model for code review by default.
  2. Before selecting a third-party or provider-qualified model, require explicit user approval that identifies:
    • The provider and model
    • The repository or files involved
    • The categories of data that may be transmitted
    • Applicable retention and training policies
  3. Do not grant the child task unrestricted cwd access to the repository. Generate the minimum required diff locally and pass only approved fragments.
  4. Apply strict file allowlists and exclude sensitive paths such as secrets, deployment configuration, private keys, environment files, credential stores, and production data fixtures.
  5. Scan diffs for API keys, passwords, tokens, private keys, personal data, internal endpoints, and other sensitive values before model processing.
  6. Redact or tokenize contributor names, email addresses, task identifiers, internal URLs, and credentials unless they are necessary for the review.
  7. Limit the child task's tools to read-only access and prohibit arbitrary network access or commands unrelated to generating the approved diff.
  8. Clearly document whether model calls are local or external. Remove contradictory claims that no external AI API is used when a provider-qualified model may be selected.
  9. Provide a fully local review mode for confidential repositories and make it the mandatory mode when repository policy prohibits third-party processing.
  10. Record auditable consent, the selected files, the data sent, the model used, and the destination without logging sensitive source content itself.
  11. Define retention and deletion controls for code snippets and contributor-associated findings stored in code_issues, code_reviews, and related analysis tables.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs deletion and replacement of period data in multiple tables but does not prominently warn the user that running it is destructive for existing records in that period. Because the workflow includes DELETE statements and overwrite semantics, omission of an explicit warning and confirmation step can lead to accidental data loss or corruption.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs sending project name, branch name, file list, and code-review context to another model session without warning about privacy, confidentiality, or data-transfer implications. In a code-analysis workflow, repository diffs and metadata may include proprietary or sensitive information, so undisclosed transmission to another model/service is a significant data-handling risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The document claims code review does not call external AI APIs, yet elsewhere instructs the agent to spawn a different model session for detailed review. That inconsistency can mislead users and operators about where code diffs and repository content are being sent, creating undisclosed data transfer and confidentiality risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are overly broad and overlap with common requests such as generating reports, analyzing commits, or syncing data. In a skill that can fetch repositories, review code, and overwrite database period data, broad triggering materially raises the risk of accidental activation and unintended destructive or privacy-impacting actions.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

L0024 直接规定“提交类型:存储中文”,并在 L0159-L0187 通过映射逻辑将类型统一转换为中文,未提供用户或系统配置的语言选择。这会强制输出/存储特定语言,不符合应允许语言或 locale 选择的自然语言政策要求。

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes analyzing repository changes, generating reports, and syncing analysis data to a code-quality database. This file additionally defines Teams and email notification scripts and email configuration, which are separate outbound communication capabilities not mentioned in the skill purpose or trigger scenarios.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The skill emphasizes that AI analysis should be performed by the assistant itself and not via external API calls. Later sections prescribe automatic delegation to a different model (bailian/kimi-k2.5) for detailed review, creating inconsistent intent about whether AI work must remain local to the current assistant versus invoking other model services.

Content

No source excerpt is available for this finding.

Skill Enumeration

Medium
Category
Agent Snooping
Confidence
80% confidence
Finding

Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.

Content

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

md
### 审查维度

参考 `skills/code-review/SKILL.md`,按以下维度系统化审查:

| 维度 | 检查项 | 优先级 |
|------|--------|--------|

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill contains extensive instructions for frontend/backend product modification, API behavior changes, SQL fixes, and troubleshooting that go well beyond code-quality analysis and data sync. This broad operational authority increases the chance of unintended codebase or production-impacting modifications when the skill is triggered by a loosely related request.

Content

No source excerpt is available for this finding.