Back to skill

Security audit

yanlin-report-gen

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed financial report generator with limited file I/O; the main caution is that standalone mode runs companion skill code and the generated Markdown should be treated as untrusted content.

Install this only if you expect a Chinese teaching/demo investment-report generator. Prefer the normal mode with known JSON inputs, use a dedicated output folder, and run --standalone only when the companion Yanlin skills are installed from a trusted source. Treat generated Markdown as untrusted if any input data or upstream collector is untrusted.

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

Warning
Location
scripts/generate_report.py:48
Finding

Unescaped Upstream Data Allows Markdown and HTML Content Injection

Content
View full analysis
= 4][:3] if high_impact_events: for i, evt in enumerate(high_impact_events[:2]): sectors_str = "/".join(evt.get('related_sectors', ['综合'])) lines.append(f"### 🎯 结论{i+1}:{evt['title'][:50]}") lines.append(f"**核心催化:** {evt['title']}") ``` Additional affected output operations include: ```python lines.append(f"| 10Y国债收益率 | {b.get('value','-')}% | {b.get('weekly_change',0):+.0f}bp | {b.get('interpretation','-')} |") ``` ```python for evt in events[:4]: stars = "⭐" * evt.get('importance', 3) sectors_str = "/".join(evt.get('related_sectors', ['综合'])) lines.append(f"### {stars} {evt['title']}") lines.append("") lines.append(f"**事件内容:** {evt['title']}") lines.append(f"**关联赛道:** {sectors_str}") ``` ```python for f in filings: lines.append(f"| {f.get('company','-')} | {f.get('event','-')[:20]} | {f.get('impact','-')[:20]} | {f.get('rating','-')} |") ``` ```python lines.append(f"| {idx.get('name','-')} | {idx.get('close',0):.2f} | {arrow} {idx.get('change_pct',0):+.2f}% | {trend} |") ``` ```python lines.append(f"- {s.get('name','-')} {s.get('change_pct',0):+.2f}%") ``` ### Technical Analysis The generator treats values loaded from externally supplied JSON files as trusted display text. Fields such as event titles, related sectors, interpretations, company names, filing descriptions, ratings, index names, and sector names are interpolated directly into Markdown without escaping Markdown metacharacters, table delimiters, line breaks, or raw HTML. An attacker who can influence an input JSON file or an upstream data-collection Skill can inject content such as: ```json { "events": [ { ...[truncated 2507 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • 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 (4)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill describes generating output files and invoking a local script with input and output paths, which implies file read/write capability, but it does not declare any explicit tool scope such as permissions or allowed-tools. This creates an authorization ambiguity where the runtime may grant broader filesystem access than users expect, increasing the risk of unintended file access or overwrite if path arguments are abused or if the script behavior changes.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This Python file hard-codes the skill name, purpose, report headings, and generated report body in Chinese, indicating the skill is designed to operate in a single language. The file does not provide any user opt-in, locale selection, or justification that the skill is intentionally region-specific, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script is described as a report generator, but in standalone mode it also performs upstream data collection by importing and executing other skills' data-fetching modules. This expands the trust boundary and attack surface: running a seemingly local report step can trigger network access or execution of unreviewed code from sibling directories, which is risky in agent pipelines.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The code modifies sys.path to load Python modules from relative cross-skill directories, then imports and executes them. This creates a code execution risk if those paths are tampered with or contain malicious replacements, because the report generator will run whatever module is found first under those names.

Content

No source excerpt is available for this finding.