Back to skill

Security audit

China Id Photo

Security checks for vulnerabilities and agentic risk

Overview

This skill locally converts user-provided portraits into Chinese ID-photo formats, with some setup and dependency risks users should understand before running it.

Install only if you are comfortable letting the agent install Python image-processing packages and download the rembg model. For sensitive identity photos, prefer a trusted environment, consider a virtual environment, and review or pin dependencies before processing private images.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:41
Finding

Automatic Installation of Unpinned Third-Party Dependencies

Content
View full analysis
/dev/null || { echo "❌ 依赖安装失败,请手动执行:" echo " pip install rembg pillow opencv-python-headless" exit 1 } echo "✅ 环境检查通过" ``` The associated first-run network behavior is documented as: ```markdown - 首次运行需下载rembg模型(约170MB),请保持网络连接 ``` ### Technical Analysis The setup instructions automatically install `rembg`, `pillow`, and `opencv-python-headless` from the active pip package index. No versions, package hashes, lockfile, trusted index URL, or other integrity constraints are specified. Consequently, dependency resolution may produce different code across executions. The effective source also depends on the invoking environment's pip configuration, including configured package indexes and mirrors. A compromised package release, transitive dependency, index, mirror, or local pip configuration could therefore introduce attacker-controlled code. Python packages may execute code during installation or when imported by the image-processing script. The command's `-q 2>/dev/null` options also suppress diagnostic information that could expose unexpected package resolution or installation warnings. The skill additionally states that `rembg` downloads an approximately 170 MB model on first use. Although this is disclosed, the instructions do not identify the download source or define an integrity-verification mechanism for the model. ### Attack Path 1. An attacker compromises a resolved package, one of its transitive dependencies, a configured pip index or mirror, or publishes a malicious version that is selected by unconstrained dependency resolution. 2. The agent follows Step 0 and runs: ```bash pip ins ...[truncated 1298 chars]
Remediation
View remediation
/dev/null` and retain pip diagnostics so package-resolution, certificate, and installation warnings remain visible. 7. Document the source and expected checksum of the `rembg` model. Verify its integrity before loading it. 8. Consider prepackaging reviewed dependencies and model artifacts in a trusted, reproducible deployment image. 9. Run image processing under a restricted account or sandbox with minimal filesystem and network access, particularly because the input consists of sensitive identity photographs. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (7)

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest states the skill supports 'custom sizes', but the code only recognizes size keys '1', '2', 'passport', and 'id_card' in the SIZES map and falls back to 1-inch for any other value. This is an active contradiction between the documented capability and the implemented behavior, not just an omitted detail.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill asserts that processing is 'completely local,' but its documented behavior requires network access to install Python packages and to download the rembg model on first run. This is dangerous because users may trust the skill with sensitive personal photos under a false privacy assumption, while the execution flow introduces external supply-chain and network exposure.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The example trigger "帮我做一张证件照" is a broad natural-language request without clear invocation boundaries or exclusion conditions. In a markdown skill description, this can cause unintended activation because it relies on common phrasing rather than a narrowly scoped command pattern.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

md
if ! command -v python3 &> /dev/null; then
  echo "❌ 需要 python3"
  echo "  macOS:  brew install python3"
  echo "  Ubuntu: sudo apt install python3"
  echo "  Windows: 从 python.org 下载安装"
  exit 1
fi

Scope Creep

Low
Category
Excessive Agency
Confidence
70% confidence
Finding

Skill's behavior or capabilities extend beyond its stated purpose. Scope creep allows an agent to perform actions unrelated to its documented functionality, increasing the attack surface.

Content

Scanner excerpt · LICENSE.txt (reported line 12)May include surrounding context.

text
permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER

Vague Triggers

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The "触发时机" section lists sample phrases, but it does not clarify whether these are exhaustive, what nearby requests should not match, or whether the skill is limited to transforming an existing portrait rather than handling any photo-related request. This lack of scope definition makes invocation behavior ambiguous.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The document presents all guidance exclusively in Chinese and does not state that the skill is intended only for Chinese-speaking users or offer any language/locale choice. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.