Back to skill

Security audit

辩证分析

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly aligned with business analysis, but it can send business topics and constraints to external search services by default and can write session files outside its workspace if given a crafted session ID.

Review this skill before installing in any confidential business environment. Disable or patch external search by default, require explicit consent before sending topics or constraints to search providers, and validate session IDs so workspace files cannot be written outside the skill directory.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
dialectic_runner.py:100
Finding

Search Enabled by Default Discloses Potentially Sensitive Business Information

Content
View full analysis
List[Dict]: """执行内置搜索(不依赖外部Skill)""" import urllib.parse import urllib.request # 1. 尝试 Tavily API api_key = os.environ.get("TAVILY_API_KEY") if api_key: try: import requests url = "https://api.tavily.com/search" payload = {"query": query, "api_key": api_key, "max_results": count} resp = requests.post(url, json=payload, timeout=15) if resp.status_code == 200: data = resp.json() results = [] for item in data.get("results", [])[:count]: results.append({ "title": item.get("title", ""), "url": item.get("url", ""), "description": item.get("content", "") }) if results: return results except Exception as e: print(f"[知识增强] Tavily API失败: {e}", file=sys.stderr) # 2. Fallback: Brave Search API api_key = os.environ.get("BRAVE_API_KEY") if api_key: try: import requests url = "https://api.search.brave.com/res/v1/web/search" headers = {"X-Subscription-Token": api_key, "Accept": "application/json"} params = {"q": query, "count": min(count, 10)} resp = requests.get(url, headers=headers, params=params, timeout=15) if resp.status_code == 200: data = resp.json() results = [] for item in data.get("web", {}).get("results", [])[:count]: results.append( ...[truncated 4177 chars]
Remediation
View remediation
Dict[str, Any]: ``` 2. Replace the ambiguous CLI option with an explicit opt-in flag: ```python parser.add_argument( "--enable-search", action="store_true", default=False, help="Send search queries to an external knowledge provider" ) ``` 3. If both enable and disable flags are required, use a mutually exclusive group with a secure default: ```python group = parser.add_mutually_exclusive_group() group.add_argument("--enable-search", dest="enable_search", action="store_true") group.add_argument("--disable-search", dest="enable_search", action="store_false") parser.set_defaults(enable_search=False) ``` 4. Before the first request, clearly identify: - The destination provider. - The data fields that will be transmitted. - Whether constraints and budget figures will be included. - The provider's applicable privacy or retention policy. 5. Require separate consent before incorporating constraints into search queries. By default, search only a sanitized, minimally necessary topic. 6. Add tests confirming that: - No network request occurs without `--enable-search`. - `--disable-search` prevents every provider fallback. - Sensitive constraints are not transmitted unless separately authorized. 7. Update `SKILL.md` so the documented behavior exactly matches the implementation. ]]>

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
dialectic_runner.py:190
Finding

Path Traversal Through Unvalidated Session ID Permits Writes Outside the Workspace

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (12)

Tainted flow: 'payload' from os.environ.get (line 105, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · dialectic_runner.py (reported line 106)May include surrounding context.

python
import requests
                url = "https://api.tavily.com/search"
                payload = {"query": query, "api_key": api_key, "max_results": count}
                resp = requests.post(url, json=payload, timeout=15)
                if resp.status_code == 200:
                    data = resp.json()
                    results = []

Tainted flow: 'headers' from os.environ.get (line 127, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · dialectic_runner.py (reported line 129)May include surrounding context.

python
url = "https://api.search.brave.com/res/v1/web/search"
                headers = {"X-Subscription-Token": api_key, "Accept": "application/json"}
                params = {"q": query, "count": min(count, 10)}
                resp = requests.get(url, headers=headers, params=params, timeout=15)
                if resp.status_code == 200:
                    data = resp.json()
                    results = []

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation presents contradictory safety claims: it says the skill does not execute external scripts, yet it documents fallback use of a local CLI tool and a free DuckDuckGo HTML interface. This can mislead operators about the actual execution and network behavior of the skill, increasing the risk of unreviewed subprocess execution, PATH hijacking, or unexpected outbound requests when search is enabled or fallback logic is triggered.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code file contains natural-language documentation and user-facing usage text only in Chinese, and the CLI help strings throughout the file are likewise Chinese-only. That effectively imposes a specific language/locale on users without an explicit opt-in or documented justification, which matches the language-policy violation criterion.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code and comments claim the search is 'built-in' and 'without external dependencies', but the implementation performs live requests to Tavily, Brave, and DuckDuckGo and may use environment-provided API keys. This mismatch can mislead operators into enabling the skill in restricted environments, causing unintended data egress of user queries and possibly sensitive topic/context data.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The hardcoded Tavily endpoint indicates deliberate external network communication. In this skill, the searched content is generated from user topics and constraints for business analysis, which can expose proprietary plans or internal strategy to third-party services if operators assume the tool is local-only.

Content

Scanner excerpt · dialectic_runner.py (reported line 104)May include surrounding context.

python
if api_key:
            try:
                import requests
                url = "https://api.tavily.com/search"
                payload = {"query": query, "api_key": api_key, "max_results": count}
                resp = requests.post(url, json=payload, timeout=15)
                if resp.status_code == 200:

External Transmission

Medium
Category
Data Exfiltration
Confidence
85% confidence
Finding

This code transmits user-supplied search queries, and potentially business-sensitive topics derived from debate inputs, to an external provider. In this skill's context, topics, background, and constraints may contain confidential strategic information, so outbound search materially increases privacy and data-leak risk even though the destination is a legitimate service.

Content

Scanner excerpt · dialectic_runner.py (reported line 106)May include surrounding context.

python
import requests
                url = "https://api.tavily.com/search"
                payload = {"query": query, "api_key": api_key, "max_results": count}
                resp = requests.post(url, json=payload, timeout=15)
                if resp.status_code == 200:
                    data = resp.json()
                    results = []

External Transmission

Medium
Category
Data Exfiltration
Confidence
83% confidence
Finding

The Brave Search endpoint is another explicit external egress path for user-derived query content. Because the tool analyzes commercial topics, constraints, and market strategy, externalizing those queries can leak sensitive organizational intent or planning data to third parties.

Content

Scanner excerpt · dialectic_runner.py (reported line 126)May include surrounding context.

python
if api_key:
            try:
                import requests
                url = "https://api.search.brave.com/res/v1/web/search"
                headers = {"X-Subscription-Token": api_key, "Accept": "application/json"}
                params = {"q": query, "count": min(count, 10)}
                resp = requests.get(url, headers=headers, params=params, timeout=15)

YARA rule 'network_reconnaissance': Network reconnaissance and scanning patterns [hacktools]

Medium
Category
YARA Match
Confidence
65% confidence
Finding

YARA rule matched a hack tool or exploit indicator (offensive tools, reconnaissance, privilege escalation, or exploit frameworks).

Content

Scanner excerpt · prompts/pro_agent.md (reported line 112)May include surrounding context.

Market growth as expected" }, { "id": "pro_1_2", "point": "Company's existing IoT platform can be reused, technical team has experience", "evidence": ["Existing project cases", "Team background"], "conditions": "Resources allocated properly" } ], "responses": [ { "target": "con_0_1", "response": "Competition is indeed fierce, but our differentiation lies in vertical scenario depth", "mitigation": "Focus on 2-3 niche scenarios first to build barriers" } ], "acknowledges_con": true, "new_points_count": 3, "persuaded": false } }

text

## Language Adaptation

- **Output language MUST match the user's input language**
- If user writes in Chinese, output in Chinese
- If user writes in English, output in English
- Maintain the same language throughout the analysis

## Key Notes

- Your critic will be tough, be prepared to respond
- Good defense is improving the solution, not simply d

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This JSON template uses Chinese-only natural-language placeholders and condition text such as "ISO8601时间戳", "核心观点", and "分析主题", which implicitly constrains the skill's content and labels to Chinese. That is a locale policy issue because the file does not offer any language selection or document that the skill is intentionally region-specific.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The report title and all section headings are written in Chinese, indicating the skill is designed to generate output in a fixed language. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This markdown template forces a specific language for all generated report headings and fixed guidance text. Under the policy, a language or locale restriction should either be optional for the user or clearly justified as region-specific, neither of which is stated here.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.