Back to skill

Security audit

TencentCloud VatInvoice OCR

Security checks for vulnerabilities and agentic risk

Overview

This is a coherent Tencent Cloud invoice OCR skill, but users should understand it sends selected invoice data to Tencent Cloud.

Install only if you are comfortable sending invoice images, PDFs, URLs, and extracted billing fields to Tencent Cloud for OCR. Use a virtual environment, consider pinning the Tencent SDK version, and provide Tencent Cloud credentials with the minimum permissions needed for OCR.

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:37
Finding
Unpinned Tencent Cloud SDK Installation Creates a Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:37`; duplicated in the dependency error guidance at `scripts/main.py:219-223` **Vulnerability Type**: Unpinned third-party dependency **Risk Level**: Medium ### Vulnerable Code ```bash pip install tencentcloud-sdk-python ``` ### Technical Analysis The installation guidance retrieves the current version of `tencentcloud-sdk-python` and its transitive dependencies from the configured Python package index without a version constraint or integrity hash. The dependency is relevant to the declared OCR functionality, and there is no evidence that its package name is intentionally deceptive. However, the installed code can change after this Skill has been audited. Consequently, review of the Skill repository does not establish the integrity of the code ultimately installed and executed. Python packages and their build systems can run code during installation, while imported SDK modules execute with the same privileges as the OCR script. If the package publisher, package-index account, distribution infrastructure, or a transitive dependency were compromised, a malicious release could execute code in the user's environment. ### Attack Path 1. An attacker compromises the SDK publishing account, a transitive dependency, or the configured package distribution channel. 2. The attacker publishes a malicious package version that remains compatible with the unpinned package name. 3. A user follows the documented `pip install tencentcloud-sdk-python` instruction. 4. The package manager resolves and installs the attacker-controlled version because no reviewed version or hash is required. 5. Malicious installation or import-time code executes with the privileges of the user running the installation or OCR script. 6. That code may access the Tencent Cloud credentials available to the process, read user-accessible invoice files, alter OCR requests or responses, or perform unrelated network activity. This path d ...[truncated 845 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin the Tencent Cloud SDK to a specific version that has been reviewed and tested: ```text tencentcloud-sdk-python==REVIEWED_VERSION ``` 2. Store dependencies in a committed requirements or lock file rather than instructing users to install an unconstrained package directly. 3. Generate and require cryptographic hashes for the pinned package and all transitive dependencies. Install them with hash verification: ```bash python -m pip install --require-hashes -r requirements.txt ``` 4. Update `SKILL.md` and the error message in `scripts/main.py` so both direct users to the reviewed, hash-locked dependency file. 5. Perform dependency updates through an explicit review process that includes package provenance verification, vulnerability scanning, release-note review, and regression testing. 6. Install and run the Skill in an isolated virtual environment or container under a non-privileged account. Expose Tencent Cloud credentials only for the duration of the OCR operation and scope those credentials to the minimum required Tencent Cloud permissions. ]]>
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
89% confidence
Finding
The skill declares use of environment-based secrets (`TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`) but does not define an explicit tool/permission scope. In an agent environment, missing scope declarations can allow broader-than-intended secret or environment access and makes it harder to enforce least privilege or audit what the skill is allowed to read.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger conditions include broad phrases such as handling 'any invoice OCR scenario' and batch invoice processing, which can cause the skill to activate in situations where the user did not explicitly intend Tencent Cloud OCR use. Overbroad triggering can route sensitive invoice images or PDFs containing financial and personal data to an external service unnecessarily, increasing privacy and compliance risk.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script transmits invoice images/PDFs and extracted billing information to Tencent Cloud OCR, but it provides no explicit warning, consent step, or privacy notice to the user. Because invoices commonly contain sensitive financial and business data, users may unknowingly send confidential information to a third-party service, creating privacy, compliance, and data-handling risk.

Static analysis

No suspicious patterns detected.