Back to skill

Security audit

TencentCloud LicensePlate OCR

Security checks for vulnerabilities and agentic risk

Overview

This license-plate OCR skill has a coherent purpose, but its local-file input can upload arbitrary readable files to Tencent Cloud if misused.

Review before installing. Use this only in a restricted environment, pass only intended vehicle images or trusted image URLs, avoid letting an agent choose local file paths automatically, and set Tencent Cloud credentials with least privilege. The publisher should add image validation, clearer third-party data disclosure, and pinned dependencies before this is treated as low-risk.

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:57
Finding
Arbitrary Local File Disclosure Through Insufficient Image Validation<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py`, lines 57-87 and 160-176 **Vulnerability Type**: Arbitrary local file read and external data transmission **Risk Level**: High ### Vulnerable Code ```python def load_image_base64(value: str) -> str: if os.path.isfile(value): with open(value, "rb") as f: raw = f.read() try: raw_str = raw.decode("utf-8").strip() base64.b64decode(raw_str, validate=True) return raw_str except (UnicodeDecodeError, ValueError): pass if len(raw) > MAX_IMAGE_SIZE_BYTES: sys.exit(1) encoded = base64.b64encode(raw).decode("utf-8") return encoded ``` The resulting data is assigned to the Tencent Cloud request and transmitted externally: ```python if args.image_url: req.ImageUrl = args.image_url elif args.image_base64: req.ImageBase64 = load_image_base64(args.image_base64) else: sys.exit(1) try: resp = client.LicensePlateOCR(req) except TencentCloudSDKException as e: sys.exit(1) ``` ### Technical Analysis The `--image-base64` argument accepts either Base64 content or any path for which `os.path.isfile()` returns true. When a path is supplied, the script reads the entire file without first verifying that it is a supported PNG or JPEG image. If the file contains valid Base64 text, the decoded content is not checked for an image signature or decoded-size limit before being returned. Otherwise, any binary file of up to 10 MB is Base64-encoded and assigned to `req.ImageBase64`. The resulting content is transmitted to `ocr.tencentcloudapi.com` through the Tencent Cloud SDK. Base64 encoding is required for the declared OCR operation and is not inherently covert. The vulnerability arises because the implementation does not constrain encoding and transmission to legitimate image files. This behavior exceeds the minimum privileges required for license-plate OCR. The feature ...[truncated 1922 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate that local input is a regular, approved image before transmitting it: - Accept only PNG, JPG, and JPEG formats. - Verify file signatures rather than relying only on filename extensions. - Reject Base64 data whose decoded bytes do not have a supported image signature. 2. Enforce size limits before loading complete files: - Use `os.stat()` to reject oversized regular files before opening them. - Read using bounded or streaming operations. - Apply the limit to decoded Base64 data, including Base64 text loaded from a file. 3. Restrict file access: - Resolve paths with `pathlib.Path.resolve()`. - If the execution environment has an approved upload directory, require the resolved file to remain inside it. - Reject symbolic links where they are not explicitly required. - Reject device files, pipes, sockets, and other non-regular inputs. 4. Separate file and literal-Base64 inputs into distinct arguments so that a user or Agent cannot ambiguously convert a path into an upload. 5. Require explicit user confirmation before uploading local files, particularly when an Agent selected the path automatically. 6. Run the Skill under a dedicated, least-privileged account with access only to files required for the current OCR operation. ]]>

T08 · Insecure Dependencies

Warning
Location
SKILL.md:32
Finding
Unpinned Tencent Cloud SDK Dependency<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 32-35 **Vulnerability Type**: Unpinned third-party dependency installation **Risk Level**: Medium ### Vulnerable Instruction ```bash pip install tencentcloud-sdk-python ``` ### Technical Analysis The installation instruction retrieves the latest version of `tencentcloud-sdk-python` and its transitive dependencies from the user's configured Python package index. No reviewed version, lockfile, integrity hash, or trusted index is specified. The package name is consistent with the documented Tencent Cloud SDK, and the reviewed project does not contain evidence that it intentionally references a typosquatted package. Nevertheless, the unpinned installation process is not reproducible and implicitly trusts all future releases and dependency resolutions. A compromised package release, compromised transitive dependency, unsafe future update, or untrusted package-index configuration could introduce code that executes during installation or whenever the Skill imports the SDK. ### Attack Path 1. A user follows the documented installation command. 2. `pip` queries the configured package index and resolves the newest compatible SDK and transitive dependencies. 3. A compromised or unsafe package version is selected because no exact versions or hashes are required. 4. Package installation logic may execute in the user's environment. 5. The Skill later imports and executes the installed SDK while Tencent Cloud credentials and image data are available. 6. Malicious dependency code could access those credentials, modify requests, read process-accessible files, or perform additional network activity. This path depends on compromise or unsafe behavior in the package supply chain or package-index configuration; the audited repository itself does not include such a payload. ### Impact Assessment Malicious dependency code would execute with the same operating-system privileges as the user running the ...[truncated 533 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the Tencent Cloud SDK to a reviewed exact version. 2. Provide a dependency lockfile containing exact versions of all transitive dependencies. 3. Use hash-verified installation, for example through a requirements file generated with hashes and installed using `pip --require-hashes`. 4. Document the expected trusted package index and avoid silently relying on arbitrary user-configured indexes. 5. Periodically review and deliberately update pinned dependencies after security and compatibility testing. 6. Install dependencies inside an isolated virtual environment under a non-administrative account. 7. Consider publishing a software bill of materials and using automated dependency vulnerability scanning in the release process. ]]>
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 (3)

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill requires access to environment variables for Tencent Cloud credentials, but it does not declare any explicit tool scope or permissions boundary. This can lead to overbroad execution context where the agent may access secrets without clear authorization controls or user visibility.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill sends uploaded image content and recognized license plate data to Tencent Cloud, but the description does not warn users that a third-party service will receive potentially sensitive personal information. License plate numbers and vehicle images can be privacy-sensitive, so omitting this disclosure undermines informed consent and can lead to unintended data exposure.

Vague Triggers

Medium
Confidence
94% confidence
Finding
The trigger conditions include a catch-all phrase for 'any scenario involving plate OCR recognition,' which is overly broad and can cause the skill to activate in contexts the user did not clearly intend. In an agent setting, broad triggers increase the chance of unnecessary third-party data transfer of images and extracted license plate information.

Static analysis

No suspicious patterns detected.