Back to skill

Security audit

CN Market Tape

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed A-share market-analysis helper that fetches public market data and caches reference files, with some data-integrity cautions but no artifact-backed malicious behavior.

Install this only if you are comfortable with it fetching public A-share market data and refreshing local theme-mapping JSON from daytrading.monster. Treat outputs as research, not investment advice, and be aware that mutable third-party theme data or shared-temp cache poisoning could affect rankings on compromised or multi-user systems.

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)

T08 · Insecure Dependencies

Warning
Location
scripts/refresh_theme_assets_from_public_source.py:20
Finding

Unpinned Third-Party Theme Data Can Manipulate Market Analysis

Content
View full analysis
dict[str, str | None]: req = Request(url, headers={"User-Agent": "codex-market-skills/refresh-theme-assets"}) try: with urlopen(req, timeout=30) as response: body = response.read() headers = response.headers except (HTTPError, URLError, TimeoutError) as exc: raise SystemExit(f"failed to download {url}: {exc}") from exc # Parse before writing so HTML error pages never replace valid assets. try: json.loads(body.decode("utf-8")) except Exception as exc: raise SystemExit(f"{url} did not return valid JSON") from exc with tempfile.NamedTemporaryFile( "wb", delete=False, dir=str(dest.parent), prefix=dest.name, suffix=".tmp", ) as tmp: tmp.write(body) tmp_path = Path(tmp.name) tmp_path.replace(dest) return { "url": url, "etag": headers.get("ETag"), "lastModified": headers.get("Last-Modified"), "contentLength": headers.get("Content-Length"), } ``` ```python parser.add_argument( "--base-url", default=DEFAULT_BASE_URL, help="Base URL that serves theme-data.json and theme-label-i18n.json", ) ``` ```python base_url = args.base_url.rstrip("/") file_meta: dict[str, dict[str, str | None]] = {} for filename in ASSET_FILES: url = f"{base_url}/{filename}" file_meta[filename] = download_json(url, target_dir / filename) ``` The corresponding Skill instruction mandates the refresh during normal theme-ranking operations: ```markdown 正常运行时执行一次映射刷新脚本;两份缓存都有效且未超过 ...[truncated 2826 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Note
Location
scripts/institutional_survey_heat.py:71
Finding

Predictable Shared Temporary Paths Permit Cache Poisoning and Write Redirection

Content
View full analysis
None: path.parent.mkdir(parents=True, exist_ok=True) path.write_text(json.dumps(data, ensure_ascii=False), encoding="utf-8") ``` The function writes predictable cache paths during survey and industry-data processing: ```python if not args.no_cache: write_cache(cache_path, {"rows": rows, "pages": pages, "count": count}) ``` ```python if not args.no_cache: write_cache(cache_path, {"industry_map": industry_map, "batches": batches}) ``` The cache and optional export directories are predictable children of the system-wide temporary directory: ```python parser.add_argument( "--output-dir", type=Path, default=Path(tempfile.gettempdir()) / "a_share_survey_heat", ) parser.add_argument( "--cache-dir", type=Path, default=Path(tempfile.gettempdir()) / "a_share_survey_heat_cache", ) ``` ### Technical Analysis The script uses fixed directory names beneath `tempfile.gettempdir()`, which is commonly a shared location such as `/tmp`. Directory creation with `mkdir(..., exist_ok=True)` does not establish that an existing directory is owned by the current user, is not a symbolic link, or has restrictive permissions. Cache writes use `Path.write_text`, which opens and truncates an existing path through ordinary filesystem semantics. It does not provide exclusive creation, reject symbolic links, verify ownership, or perform an atomic replacement from a securely created temporary file. The generated cache filename is deterministic because it is derived from known request parameters. CSV export names are also fixed. On a multi-user system, an attacker with access to the same shared temporary namespace may be able to pre-create directories, cache files, or symbolic ...[truncated 1686 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (9)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This version of the mismatch is security-relevant because the skill explicitly includes downloading theme assets from an external public source, validating cache freshness, and writing local files, while those behaviors are not clearly bounded by declared permissions or reflected in the high-level description. Hidden or under-documented network fetch and local persistence can undermine operator trust and create supply-chain, integrity, or data-handling risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This version of the mismatch is security-relevant because the skill explicitly includes downloading theme assets from an external public source, validating cache freshness, and writing local files, while those behaviors are not clearly bounded by declared permissions or reflected in the high-level description. Hidden or under-documented network fetch and local persistence can undermine operator trust and create supply-chain, integrity, or data-handling risk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This version of the mismatch is security-relevant because the skill explicitly includes downloading theme assets from an external public source, validating cache freshness, and writing local files, while those behaviors are not clearly bounded by declared permissions or reflected in the high-level description. Hidden or under-documented network fetch and local persistence can undermine operator trust and create supply-chain, integrity, or data-handling risk.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill describes behaviors that require file reads, file writes, and network access, but it declares no explicit tool scope or permission boundaries. In an agent environment, missing scope declarations can let the runtime grant broader capabilities than intended, increasing the chance of unintended data access, persistence, or external requests.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instruction '始终用中文回答' mandates a single language for all outputs. This is a natural-language locale policy constraint and the file does not offer the user any language choice or opt-in mechanism.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This markdown file presents all operational instructions in Chinese and does not indicate that the user may choose another language. Under the language/locale policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Line L03 states that specific information is omitted from the user's default answer, and the surrounding document is written as an operational reference entirely in Chinese, implying a Chinese-default response policy. The file does not offer an alternative language or indicate that language choice depends on user preference, which is a locale/language policy concern under the rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown reference instructs the agent to use a specific Chinese phrase (周期位置暂不确认) and later defines output labels and templates entirely in Chinese. That creates a natural-language locale constraint without any user opt-in or explicit justification that the skill must operate only in Chinese.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The validation requires the downloaded label file to contain at least one zh label, which encodes a specific language/locale requirement in program logic. This is a natural-language policy concern because the file does not offer user choice or explain a justified region-specific constraint within the script itself.

Content

No source excerpt is available for this finding.