Back to skill

Security audit

Tencent Web Search API

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Tencent Cloud news search skill, but it needs review because its credential and file-output handling are weaker than its documentation claims.

Review before installing. Use only dedicated, least-privileged temporary Tencent Cloud keys, add your own .gitignore entry for config.json, avoid absolute or sensitive output paths, run the skill in an isolated directory or container, and rotate any credentials used during testing.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tencent_hotsearch.py:295
Finding

Output Path Validation Allows Arbitrary File Overwrite Outside the Configured Directory

Content
View full analysis
Path: """ Validate and sanitize output path to prevent directory traversal attacks. Args: output_path: Path to validate Returns: Validated Path object Raises: ValueError: If path is invalid or attempts directory traversal """ output_file = Path(output_path).resolve() # Get the configured output directory config_output_dir = Path(self.config.get('output_dir', './output')).resolve() # Ensure the output file is within the configured output directory try: output_file.relative_to(config_output_dir) except ValueError: # If output_file is not relative to config_output_dir, check if it's an absolute path # For absolute paths, just ensure it doesn't contain suspicious patterns if '..' in str(output_path): raise ValueError( f"Invalid output path: Directory traversal detected. " f"Path must be within the configured output directory ({config_output_dir})" ) # Check for suspicious patterns if '..' in str(output_path): raise ValueError( f"Invalid output path: Directory traversal not allowed. " f"Use paths within {config_output_dir}" ) # Ensure parent directory exists output_file.parent.mkdir(parents=True, exist_ok=True) return output_file ``` The validated path is subsequently opened in write mode by `save_results()`, such as: ```python with open(output_file, 'w', encoding='utf-8') as f: ``` ### Technical Analysis The validation attempts to establish that the resolved output path is contained within the configured output directory by calling `output_file ...[truncated 2198 chars]
Remediation
View remediation
Path: config_output_dir = Path( self.config.get("output_dir", "./output") ).expanduser().resolve() candidate = Path(output_path).expanduser() if not candidate.is_absolute(): candidate = config_output_dir / candidate output_file = candidate.resolve() try: output_file.relative_to(config_output_dir) except ValueError as exc: raise ValueError( f"Output path must be within {config_output_dir}" ) from exc config_output_dir.mkdir(parents=True, exist_ok=True) output_file.parent.mkdir(parents=True, exist_ok=True) return output_file ``` Additional hardening should include: 1. Treat relative output paths as relative to `output_dir`, rather than the process working directory. 2. Reject every resolved path outside `output_dir`, regardless of whether its text contains `..`. 3. Consider refusing symbolic-link targets or opening files using directory-relative, no-follow operating-system APIs where available if hostile local users are in scope. 4. Avoid overwriting existing files unless the user explicitly requests it, for example by using exclusive creation mode. 5. If arbitrary absolute paths are an intended feature, remove the false containment claim and require explicit trusted-user authorization before writing outside `output_dir`. 6. Run the Skill under a dedicated, non-privileged account with access only to the intended output directory. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
config.json:1
Finding

Plaintext Credential Workflow Lacks the Documented Version-Control Protection

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (8)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · CONFIG.md (reported line 126)May include surrounding context.

On Linux/macOS systems, set file access permissions:

bash
chmod 600 config.json

This ensures only the file owner can read and modify the configuration file.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The README makes a security claim that output paths are restricted to the configured output directory and protected against traversal, but elsewhere documents arbitrary relative and absolute output paths as valid. This inconsistency can mislead users into trusting a path-safety control that may not actually exist or may be bypassable, increasing the chance of writing files outside the intended sandbox and exposing or overwriting sensitive files.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
99% confidence
Finding

The document says users should report vulnerabilities privately, but then instructs them to open a GitHub issue, which is typically public. This can lead to accidental public disclosure of vulnerabilities before a fix is available, increasing the risk of exploitation and harming coordinated disclosure.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · README.md (reported line 390)May include surrounding context.

md
- ✅ **Use Temporary API Keys**: Only use temporary/least-privileged API keys for testing
- ✅ **Rotate Keys Regularly**: Change API keys periodically and after each testing session
- ✅ **Never Commit config.json**: The file is already in `.gitignore` - respect this
- ✅ **Set File Permissions**: Use `chmod 600 config.json` on Linux/macOS
- ✅ **Use Dedicated Keys**: Create separate API keys for this skill, not your production keys
- ✅ **Monitor Usage**: Regularly check API usage in Tencent Cloud console

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SECURITY.md (reported line 31)May include surrounding context.

md
- ✅ **Use Temporary API Keys**: Only use temporary/least-privileged API keys for testing
- ✅ **Rotate Keys Regularly**: Change API keys periodically and after each testing session
- ✅ **Never Commit config.json**: The file is already in `.gitignore` - respect this
- ✅ **Set File Permissions**: Use `chmod 600 config.json` on Linux/macOS
- ✅ **Use Dedicated Keys**: Create separate API keys for this skill, not your production keys
- ✅ **Monitor Usage**: Regularly check API usage in Tencent Cloud console

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SECURITY.md (reported line 59)May include surrounding context.

md
- ✅ **Use Temporary API Keys**: Only use temporary/least-privileged API keys for testing
- ✅ **Rotate Keys Regularly**: Change API keys periodically and after each testing session
- ✅ **Never Commit config.json**: The file is already in `.gitignore` - respect this
- ✅ **Set File Permissions**: Use `chmod 600 config.json` on Linux/macOS
- ✅ **Use Dedicated Keys**: Create separate API keys for this skill, not your production keys
- ✅ **Monitor Usage**: Regularly check API usage in Tencent Cloud console

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 94)May include surrounding context.

md
- ✅ **Use Temporary API Keys**: Only use temporary/least-privileged API keys for testing
- ✅ **Rotate Keys Regularly**: Change API keys periodically and after each testing session
- ✅ **Never Commit config.json**: The file is already in `.gitignore` - respect this
- ✅ **Set File Permissions**: Use `chmod 600 config.json` on Linux/macOS
- ✅ **Use Dedicated Keys**: Create separate API keys for this skill, not your production keys
- ✅ **Monitor Usage**: Regularly check API usage in Tencent Cloud console

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest description says to invoke the skill whenever a user wants to get hot news, trending topics, or search for articles on keywords. Those requests are common, everyday intents and the description does not clearly bound when this specific Tencent-cloud-backed skill should be chosen instead of general web search or other news tools.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.