Back to skill

Security audit

TencentCloud VehicleLicense OCR

Security checks for vulnerabilities and agentic risk

Overview

This skill does what it claims, but its file-path upload path can send any readable local file to Tencent Cloud if misused.

Review before installing. Use only in a restricted environment, pass only intended vehicle-license image files or trusted image URLs, avoid exposing broad filesystem access to agent-driven invocations, and set Tencent Cloud credentials only for this skill's run. The publisher should add explicit privacy notice/consent, validate image content, restrict local paths, and pin dependencies.

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

Error
Location
scripts/main.py:64
Finding
Arbitrary Local File Content Can Be Uploaded to the OCR Service<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py`, lines 64–80 and 277–280 **Vulnerability Type**: Arbitrary local file read and external transmission **Risk Level**: High ### Vulnerable Code ```python if os.path.isfile(value): with open(value, "rb") as f: raw = f.read() # If the file content is already Base64 text, use it directly try: raw_str = raw.decode("utf-8").strip() base64.b64decode(raw_str, validate=True) return raw_str except (UnicodeDecodeError, ValueError): pass # Otherwise encode the binary file as Base64 if len(raw) > MAX_IMAGE_SIZE_BYTES: print(f"Error: image file exceeds the {MAX_IMAGE_SIZE_BYTES // (1024 * 1024)}MB limit", file=sys.stderr) sys.exit(1) encoded = base64.b64encode(raw).decode("utf-8") return encoded ``` The resulting content is assigned directly to the outbound Tencent Cloud OCR request: ```python if args.image_url: req.ImageUrl = args.image_url elif args.image_base64: req.ImageBase64 = load_image_base64(args.image_base64) ``` ### Technical Analysis The `--image-base64` argument is documented as accepting an image, Base64 data, or a path to an image or Base64 text file. However, `load_image_base64()` accepts any path for which `os.path.isfile()` returns true. It reads the file without validating its type, magic bytes, MIME type, or ability to decode as a supported image. For non-Base64 files, the function Base64-encodes the raw bytes. Base64 is only a transport encoding and does not provide confidentiality. The encoded content is subsequently assigned to `req.ImageBase64` and sent through the Tencent Cloud SDK to `ocr.tencentcloudapi.com`. Consequently, the program's effective file-access capability is broader than the minimum privilege required for vehicle-license OCR. Any readable file of up to 7 MB can enter the external upload path, including configuration files, environment files, SSH private keys, clou ...[truncated 1654 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate file content before constructing any network request: - Check trusted image magic bytes rather than relying on file extensions. - Decode the file with a maintained image library. - Restrict accepted formats to those supported by the OCR API, such as JPEG, PNG, and BMP. - Reject text files, archives, executables, and unknown binary formats. 2. Restrict local path access: - Resolve paths with `Path.resolve()`. - Require files to reside under an explicitly approved upload or workspace directory. - Reject paths outside that directory and consider rejecting symbolic links. - Avoid allowing arbitrary absolute paths. 3. Separate Base64 text from file-path input: - Use distinct arguments such as `--image-file` and `--image-base64`. - Validate decoded Base64 bytes as an image before transmission. 4. Apply size checks to both raw files and decoded Base64 content before processing and uploading them. 5. In agent-driven environments, require explicit user confirmation showing the resolved local path and external destination before uploading local data. 6. Clearly document that vehicle-license images and recognized personal data are transmitted to Tencent Cloud and may be subject to third-party retention and privacy policies. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:36
Finding
Third-Party SDK Installation Is Not Version-Pinned<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, line 36; related runtime guidance in `scripts/main.py`, line 259 **Vulnerability Type**: Mutable third-party dependency installation **Risk Level**: Medium ### Vulnerable Code The installation documentation uses an unpinned package specification: ```text Dependency: `tencentcloud-sdk-python` (install using `pip install tencentcloud-sdk-python`) ``` The runtime error repeats the same installation instruction: ```python except ImportError: print("Error: missing dependency tencentcloud-sdk-python; run: pip install tencentcloud-sdk-python", file=sys.stderr) sys.exit(1) ``` ### Technical Analysis Installing `tencentcloud-sdk-python` without a fixed, reviewed version causes the package index to resolve whichever release is current at installation time. The project does not provide a lock file, version constraint, package hash, or reproducible dependency manifest. No evidence was found that the named package is currently malicious, and its name is consistent between the documentation and source code. The risk is supply-chain mutability: a future compromised, malicious, or incompatible release could be installed without any change to the audited Skill. Python package installation may execute package-controlled build logic, and installed SDK code executes within the same process and privileges as this Skill. The SDK also receives Tencent Cloud credentials and processes sensitive vehicle-license images, making dependency integrity particularly important. ### Attack Path 1. A user or automated deployment follows the documented `pip install tencentcloud-sdk-python` instruction. 2. The configured package index resolves an unreviewed release because no version or hash is required. 3. If the selected release or its transitive dependencies have been compromised, malicious installation or runtime code executes. 4. The dependency runs with the permissions of the installing or invoking user. 5. At ...[truncated 823 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `tencentcloud-sdk-python` to a specific version that has been reviewed and tested. 2. Use a dependency lock file or requirements file with cryptographic hashes, for example through `pip-compile` and `pip install --require-hashes`. 3. Pin and review transitive dependencies rather than relying only on a top-level version constraint. 4. Install packages exclusively from an explicitly configured, trusted package index or an internally controlled artifact repository. 5. Perform dependency vulnerability and integrity scanning as part of release and update workflows. 6. Test upgrades deliberately and update the pinned version only after reviewing release notes, package provenance, and security advisories. 7. Install and run the Skill in a least-privileged virtual environment or container without unnecessary filesystem or network access. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (5)

Missing User Warnings

High
Confidence
97% confidence
Finding
The skill processes images of vehicle licenses and extracts sensitive personal and regulated information such as owner name, address, plate number, VIN, and engine number, but it does not warn users that the image/data will be transmitted to Tencent Cloud. This creates a meaningful privacy and compliance risk because users may unknowingly share sensitive government-document data with an external service.

Lp3

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding
The skill declares access to environment-based secrets (`TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`) but does not define an explicit tool/permission scope. That weakens least-privilege guarantees and can cause the runtime to expose broader capabilities than users or reviewers expect, especially for a third-party OCR integration handling sensitive documents.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger conditions include a broad catch-all phrase covering essentially any vehicle-license OCR scenario, which can cause the skill to be invoked unexpectedly. In this context, accidental invocation is risky because the skill sends highly sensitive identity and vehicle registration data to an external cloud OCR provider.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script transmits vehicle license images and extracted identity/vehicle data to Tencent Cloud OCR, but it does not provide any explicit privacy notice, consent prompt, or warning that sensitive document contents will leave the local environment. Because vehicle licenses contain personal and regulated information, users may unknowingly disclose PII to a third-party service, creating privacy, compliance, and trust risks even if the transmission is intended functionality.

Natural-Language Policy Violations

Low
Confidence
91% confidence
Finding
The script's human-facing docstrings, help text, errors, and output labels are consistently fixed in Chinese, with no option for users to select another language or locale. The policy calls for flagging language constraints when a skill forces a specific language without user opt-in.

Static analysis

No suspicious patterns detected.