Back to skill

Security audit

审核质检

Security checks for vulnerabilities and agentic risk

Overview

The skill is purpose-aligned for ad review workflows, but its automated quality checks are mock/random and its review commands allow unbounded, weakly validated batch state changes.

Review this carefully before installing in any production ad approval or compliance workflow. It does not actually inspect materials for the advertised automated checks, and large or malformed review submissions could corrupt statistics or exhaust the skill process. It is more appropriate as a prototype unless validation, batch limits, and real deterministic material checks are added.

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

Warning
Location
index.ts:30
Finding
Unbounded Review Storage and Batch Processing Can Exhaust Process Resources## Vulnerability Details **File Location**: `index.ts`, lines 30 and 79–119 **Vulnerability Type**: Unbounded memory consumption and unrestricted batch processing **Risk Level**: Medium ### Vulnerable Code ```typescript private reviews: Map<string, Review> = new Map(); ``` ```typescript this.reviews.set(id, newReview); ``` ```typescript async batchReview(reviews: Array<{ taskId: string; materialId: string; score: number; passed: boolean; comments?: string; issues?: string[]; }>): Promise<{submitted: number; ids: string[]}> { const ids: string[] = []; for (const review of reviews) { const id = await this.submitReview(review); ids.push(id); } this.api.log(`info`, `Batch review completed: ${ids.length} reviews submitted`); return { submitted: ids.length, ids }; } ``` ### Technical Analysis Every submitted review is retained indefinitely in an in-memory `Map`. There is no maximum record count, expiration policy, eviction mechanism, or persistence strategy that would bound process memory usage. The batch review method also processes the entire caller-controlled array without enforcing a maximum batch size. Each item creates a review, adds it to the map, writes a log entry, and emits at least one event. Rejected reviews emit an additional event. Consequently, a large batch has both immediate CPU and event-processing costs and a permanent memory cost for the lifetime of the skill process. Repeated requests compound the issue because records are never removed. Even if an individual request is constrained by an upstream transport, repeated submissions can still grow the map until the process experiences excessive garbage collection, degraded responsiveness, or heap exhaustion. ### Attack Path 1. An attacker or untrusted caller invokes the `review batch` command with a very large `materialIds` array. 2. The command converts every material ident ...[truncated 892 chars]
Remediation
## Remediation Suggestions - Enforce a strict maximum batch size at the command boundary and again inside `batchReview`. - Apply per-user and global rate limits to submission and batch commands. - Limit the total number of records retained in memory. - Add time-based expiration or least-recently-used eviction if in-memory storage is intentional. - Prefer durable storage with quotas, pagination, retention policies, and indexed queries. - Reject requests before processing if their serialized size exceeds an established limit. - Limit event and log volume, especially for batch operations. - Process approved batches in bounded chunks and apply backpressure to downstream event consumers. - Add monitoring for record count, heap usage, batch size, and event queue depth.

T09 · Insecure Skill Coding Practices

Warning
Location
index.ts:55
Finding
Missing Review Input Validation Permits Data Integrity Corruption and Resource Amplification## Vulnerability Details **File Location**: `index.ts`, lines 55–84 **Vulnerability Type**: Improper input validation **Risk Level**: Medium ### Vulnerable Code ```typescript async submitReview(review: { taskId: string; materialId: string; score: number; passed: boolean; comments?: string; issues?: string[]; }): Promise<string> { const id = `REV-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`; const newReview: Review = { id, taskId: review.taskId, materialId: review.materialId, reviewer: this.api.user?.id || "anonymous", score: review.score, passed: review.passed, comments: review.comments, issues: review.issues || [], createdAt: new Date(), updatedAt: new Date(), }; this.reviews.set(id, newReview); this.api.log(`info`, `Review submitted: ${id} for material ${review.materialId}`); // Emit event this.api.emit("review.completed", { reviewId: id, review: newReview }); // If review fails, trigger regeneration request if (!review.passed) { this.api.emit("review.rejected", { materialId: review.materialId, review: newReview }); } return id; } ``` The command describes the score as being between zero and ten, but only declares it as a generic number: ```typescript score: { type: "number", required: true, help: "Score (0-10)" }, ``` ### Technical Analysis `submitReview` accepts and stores review fields without enforcing semantic constraints. In particular, the documented score range of zero through ten is not checked. Identifier lengths, comment lengths, issue counts, and individual issue lengths are also unrestricted. Invalid scores are subsequently used directly by `getStats` when calculating the average. A caller can therefore inject negative or excessively large values and cause the reported statistics to no longer represent the advertised scoring model. Oversized comments ...[truncated 1627 chars]
Remediation
## Remediation Suggestions - Validate that `score` is finite and within the inclusive range `[0, 10]`. - Reject empty identifiers and enforce conservative maximum lengths for `taskId` and `materialId`. - Set maximum lengths for comments and individual issue descriptions. - Set a maximum number of issues per review. - Validate all values at runtime with a schema validator or explicit checks before creating a record. - Reject unexpected properties if the command framework permits strict schemas. - Normalize identifiers only where doing so cannot create collisions or authorization ambiguity. - Limit the total serialized size of each review and its emitted event payload. - Ensure downstream renderers encode comments and issues according to their output context. - Add tests for boundary values, negative scores, oversized values, empty identifiers, and malformed arrays.

other

Note
Location
index.ts:37
Finding
Mock Automatic Review Returns Random and Fabricated Quality Results## Vulnerability Details **File Location**: `index.ts`, lines 37–48 **Vulnerability Type**: Quality decision integrity weakness **Risk Level**: Low ### Vulnerable Code ```typescript async autoCheck(materialId: string): Promise<QualityCheck> { // Would integrate with material-library to get material // For now, return mock check const check: QualityCheck = { materialId, automatedScore: Math.random() * 10, checks: { resolution: true, artifacts: false, watermark: false, nsfw: false, blur: false }, suggestions: [] }; ``` ### Technical Analysis The automatic review routine does not retrieve or inspect the identified material. It assigns a random score and returns fixed values for resolution, artifact, watermark, NSFW, and blur checks. These results are exposed through the automatic review command as if they were quality-assessment findings. The same method is called in response to `generation.completed`, where random scores below five produce low-quality warnings. This is primarily an integrity and operational safety issue rather than a privilege-escalation vulnerability. If downstream workflows treat the output as authoritative, identical material can receive inconsistent scores, while prohibited or defective material can receive fixed negative findings that falsely indicate no problem was detected. ### Attack Path 1. A material is generated or a caller invokes the automatic check command. 2. `autoCheck` receives only the material identifier and does not load the material. 3. The method generates a random score and fixed check results. 4. The response presents those values as automated quality findings. 5. A downstream workflow or operator relies on the fabricated results. 6. Material may be incorrectly accepted, rejected, or escalated without any actual inspection. ### Impact Assessment No additional technical privileges are ...[truncated 466 chars]
Remediation
## Remediation Suggestions - Do not expose the current implementation as a production quality or compliance check. - Clearly label mock results in both command responses and documentation if the implementation is retained for testing. - Replace the random score with deterministic analysis derived from the actual material. - Retrieve the material through a trusted interface and validate its identity before assessment. - Implement each advertised check or mark unsupported checks as unavailable rather than returning a passing value. - Record the checker version, criteria, evidence, and timestamp with every automated result. - Prevent automated approval or publication when required checks were not performed. - Add deterministic test fixtures for compliant, defective, and prohibited material.
Vulnerability Patterns
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (5)

Natural-Language Policy Violations

Medium
Confidence
93% confidence
Finding
The manifest description, title, and setup text are written in Chinese, and the file does not indicate that the skill supports other languages or that Chinese is a required locale. This can violate language/locale policy when users are not given an explicit choice or opt-in for the enforced language.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The skill hard-codes user-facing suggestion strings in Chinese, and the command descriptions/help text elsewhere in the file are also exclusively Chinese. This creates a language/locale policy concern because users are not offered any language opt-in or alternative locale, and no region-specific justification is documented in the file.

Natural-Language Policy Violations

Low
Confidence
95% confidence
Finding
The description is written entirely in Chinese ("审核质检技能 - 自动化质量评估和人工审核工作流"), which indicates a language-specific skill presentation without any accompanying note that the language is user-selectable or intentionally region-specific. Under the policy, language constraints should be opt-in or clearly justified.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"license": "MIT",
  "dependencies": {},
  "devDependencies": {
    "@types/node": "^20.0.0",
    "typescript": "^5.0.0"
  }
}
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"dependencies": {},
  "devDependencies": {
    "@types/node": "^20.0.0",
    "typescript": "^5.0.0"
  }
}
Confidence
40% confidence
Finding
Dependencies lack version pinning, allowing potential malicious package updates. Consider pinning versions.

Static analysis

No suspicious patterns detected.