Back to skill

Security audit

tencentcloud-faceid-detectface

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it can upload any readable local file supplied as an image path to Tencent Cloud and lacks strong privacy safeguards for face data.

Review before installing. Use it only with images you intend to send to Tencent Cloud, avoid giving it arbitrary local paths, and run it in a restricted environment with narrowly scoped Tencent Cloud credentials. Consider adding file-type validation, an explicit biometric-data consent prompt, and pinned dependencies before broad use.

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:64
Finding
Arbitrary Local Files Can Be Encoded and Uploaded to Tencent Cloud<![CDATA[ ## Vulnerability Details **File Location**: `scripts/main.py:64-100` and `scripts/main.py:228-233` **Vulnerability Type**: Insufficient file-type and path validation before third-party upload **Risk Level**: Medium ### Vulnerable Code ```python def load_base64_image(value: str) -> str: """ Load image Base64 content. If value is an existing file path, read the file and encode it as Base64; otherwise, treat it directly as a Base64 string. """ if os.path.isfile(value): ext = os.path.splitext(value)[1].lower() if ext not in IMAGE_EXTENSIONS: print( f"Warning: file extension '{ext}' is not in the supported list " f"{sorted(IMAGE_EXTENSIONS)}; upload will still be attempted", file=sys.stderr, ) with open(value, "rb") as f: raw = f.read() try: raw_str = raw.decode("utf-8").strip() decoded = base64.b64decode(raw_str, validate=True) _check_image_size(len(decoded)) return raw_str except SystemExit: raise except Exception: pass _check_image_size(len(raw)) return base64.b64encode(raw).decode("utf-8") else: try: decoded = base64.b64decode(value, validate=True) _check_image_size(len(decoded)) except SystemExit: raise except Exception: print( "Error: the provided content is neither valid Base64 nor a valid file path", file=sys.stderr, ) sys.exit(1) return value ``` The resulting content is then included in the external API request: ```python if args.url: params["Url"] = args.url print(f"Using image URL: {args.url}", file=sys.stderr) else: print(f"Loading image: {args.image}", file=sys.stderr) params["Image"] = load_base64_image(args.image) print("Image Base64 enc ...[truncated 2546 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Reject unsupported extensions instead of continuing after a warning. 2. Validate file signatures and decode the file with a trusted image library before upload. Confirm that the decoded format is one of PNG, JPEG, or BMP. 3. Do not rely on filename extensions or MIME labels alone. 4. Restrict local file inputs to a designated, user-approved upload directory. Resolve paths with `os.path.realpath()` and verify that the resolved path remains inside the allowed directory. 5. Reject symbolic links or verify their resolved targets before opening them. 6. Open files only after validation and use a bounded read to enforce the size limit before loading the entire file into memory. 7. Require explicit user confirmation identifying the destination service before uploading local biometric images. 8. Document that image content is transmitted to Tencent Cloud and may be subject to external retention, privacy, and jurisdictional policies. ]]>

T08 · Insecure Dependencies

Note
Location
SKILL.md:30
Finding
Unpinned Tencent Cloud SDK Dependency Installation<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:30-32` and `scripts/main.py:193-205` **Vulnerability Type**: Unpinned third-party dependency and mutable supply-chain resolution **Risk Level**: Low ### Vulnerable Code The installation documentation instructs users to install the latest package resolved by the package index: ```markdown ## Environment Requirements - Python 3.6+ - Dependency: `tencentcloud-sdk-python` (install with `pip install tencentcloud-sdk-python`) - Environment variables: - `TENCENTCLOUD_SECRET_ID` - `TENCENTCLOUD_SECRET_KEY` ``` The executable also repeats this unpinned installation instruction when the dependency is unavailable: ```python try: from tencentcloud.common import credential from tencentcloud.common.profile.client_profile import ClientProfile from tencentcloud.common.profile.http_profile import HttpProfile from tencentcloud.common.exception.tencent_cloud_sdk_exception import ( TencentCloudSDKException, ) from tencentcloud.iai.v20200303 import iai_client, models except ImportError: print( "Error: missing dependency tencentcloud-sdk-python; " "run: pip install tencentcloud-sdk-python", file=sys.stderr, ) sys.exit(1) ``` ### Technical Analysis The project neither pins the Tencent Cloud SDK to a reviewed version nor provides a lock file with integrity hashes. Running the documented command resolves a mutable package version from the user's configured Python package index. The package name is consistent with the declared official Tencent Cloud SDK; the audit found no evidence of deliberate typosquatting or dependency confusion in the current source. Nevertheless, unconstrained installation means a future compromised, malicious, or incompatible release could be selected without any change to the audited Skill package. Python package installation may execute build-related code, and imported dependency code subsequently executes with the s ...[truncated 1444 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin `tencentcloud-sdk-python` to a specific, reviewed version. 2. Maintain a lock file containing exact transitive dependency versions. 3. Use hash-verified installation, such as a requirements file with `--hash` entries and `pip install --require-hashes`. 4. Install dependencies from a trusted, explicitly configured package index. 5. Review and update pinned dependencies through a controlled process that includes vulnerability scanning and regression testing. 6. Install the dependency in an isolated virtual environment under a non-privileged account. 7. Avoid exposing cloud credentials during package installation; provide credentials only when the audited runtime starts. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Lp3

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding
The skill references environment-based secrets (`TENCENTCLOUD_SECRET_ID` and `TENCENTCLOUD_SECRET_KEY`) but does not declare any tool scope or permissions boundary. This weakens least-privilege controls and can cause the runtime to expose environment access implicitly, making secret use less transparent and harder to audit.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
This skill sends user-supplied face images and may return biometric-related attributes such as age, gender, mask status, and facial quality data to Tencent Cloud for external processing, but the description does not warn users about that data transfer. Because face images and derived attributes are highly sensitive personal data, lack of disclosure can lead to privacy violations, non-compliant handling, and unsafe use without informed consent.

Natural-Language Policy Violations

Medium
Confidence
91% confidence
Finding
All user-facing documentation, help text, warnings, and output descriptions in the file are written in Chinese, which imposes a specific language on users. The file does not offer a language/locale option or explain that the tool is intentionally limited to a Chinese-speaking or region-specific audience.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script transmits biometric data (face images) or remotely fetched image URLs to Tencent Cloud for processing, but it does not provide any explicit privacy notice, consent prompt, or warning that sensitive personal data leaves the local environment. Because facial images and inferred attributes are highly sensitive, users may unknowingly expose personal or regulated data to a third party, creating privacy, compliance, and trust risks.

Static analysis

No suspicious patterns detected.