Back to skill

Security audit

TencentCloud IDCard OCR

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it processes highly sensitive ID-card data through Tencent Cloud and can upload any readable local file supplied as an image path.

Review before installing. Use this only for ID-card images you are authorized to process, assume submitted images and OCR results may be handled by Tencent Cloud, keep Tencent credentials in a protected secret store, and avoid passing arbitrary local paths because non-image files could be uploaded. Prefer running it in a restricted environment until file-type validation and explicit consent warnings are added.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.py:66
Finding

Arbitrary Local File Contents Can Be Transmitted to the OCR Service

Content
View full analysis
MAX_IMAGE_SIZE_BYTES: sys.exit(1) return encoded ``` The resulting content is assigned to the OCR request and sent to Tencent Cloud: ```python elif args.image_base64: req.ImageBase64 = load_image_base64(args.image_base64) try: resp = client.IDCardOCR(req) except TencentCloudSDKException as e: sys.exit(1) ``` ### Technical Analysis The `--image-base64` argument accepts either a Base64 value or any path for which `os.path.isfile()` returns true. When a path is supplied, the script reads the complete file. If the content is not already valid Base64 text, it Base64-encodes the raw bytes and submits them through the Tencent Cloud OCR SDK. Base64 encoding is a normal and documented transport mechanism for the OCR API, so the encoding operation is not inherently covert or malicious. However, the implementation does not verify that the selected file is actually an image. It does not check a trusted MIME type, image signature, supported format, or successful decoding through an image parser. Consequently, any readable file smaller than the 10 MB limit can be placed into the outbound OCR request. This exceeds the minimum file access needed for the declared ID-card image recognition functionality. ### Attack Path 1. An attacker gains influence over the arguments used to invoke the Skill, such as by supplying an untrusted path ...[truncated 1323 chars]
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
SKILL.md:30
Finding

Third-Party SDK Installation Is Unpinned and Lacks Integrity Verification

Content
View full analysis
Remediation
View remediation
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
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (9)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

This skill handles Chinese resident ID card images and extracts fields such as name, address, and ID number, which are highly sensitive personal data, yet the documentation does not clearly warn users that both the image and recognition results may be sent to a cloud provider. In this context, missing disclosure undermines informed consent and can lead to serious privacy, regulatory, and data-handling violations.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
85% confidence
Finding

The skill declares use of environment-based credentials but does not define any explicit tool scope or permission boundary. That makes the skill's operational capabilities less transparent to the host agent and increases the risk of over-broad access or unintended execution paths involving sensitive secrets.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger conditions are broad enough to match 'any scenario involving ID card OCR recognition,' which can cause the skill to be invoked automatically in situations the user did not clearly intend. Because the skill processes highly sensitive identity documents and may transmit them to a third-party cloud API, accidental invocation materially increases privacy and compliance risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documentation instructs operators to use Tencent Cloud secret environment variables but provides no guidance on secure storage, rotation, least privilege, or avoiding disclosure. In agent environments, this omission can contribute to accidental credential leakage, misuse of cloud APIs, or unsafe operational practices around secret management.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

User-facing strings, help text, errors, and output annotations are consistently in Chinese, and warning descriptions are explicitly converted to Chinese-only labels. The file does not offer a language option or explain that the skill is intentionally limited to Chinese-speaking users or a China-specific compliance context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The --image-base64 parameter accepts an arbitrary local filesystem path and reads the file contents, then either forwards them as-is if they are valid Base64 text or encodes the raw bytes and sends them to the remote OCR API. In an agent/skill setting, this broadens the capability from OCRing supplied image data to local file exfiltration, including accidental transmission of sensitive host files unrelated to the user's image.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script sends highly sensitive personal data—ID card images and extracted identity fields—to a remote cloud OCR service, but it provides no explicit runtime notice, consent check, or data-handling warning. In a skill context, users or orchestrating agents may not realize that local images or image URLs containing identity documents are transmitted off-host to a third party, increasing privacy and compliance risk.

Content

No source excerpt is available for this finding.

Dynamic attribute access via getattr()

Low
Category
Dangerous Code Execution
Confidence
50% confidence
Finding

Dynamic getattr() with a non-literal attribute name can access arbitrary object attributes, potentially bypassing access controls.

Content

Scanner excerpt · scripts/main.py (reported line 160)May include surrounding context.

python
common_fields = ["AdvancedInfo", "RequestId"]

    for field in front_fields + back_fields + common_fields:
        val = getattr(resp, field, None)
        if val:
            output[field] = val

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text states the client identifier is '统一固定为 Skills', implying it is fixed. In reality, the parser accepts any --user-agent string and the code passes it through to client_profile.request_client, so the documentation contradicts actual behavior.

Content

No source excerpt is available for this finding.