Back to skill

Security audit

Valu Ai

Security checks for vulnerabilities and agentic risk

Overview

This stock-analysis skill is not malicious, but it deserves review because it sends reports to DeepSeek and keeps local quota, billing, and user-state files with weak controls.

Install only if you are comfortable with a Chinese-focused finance tool that calls external market-data services and DeepSeek, writes reports/logs/user quota data locally, and does not provide strong authentication or reliable billing controls. Treat generated investment reports as AI-assisted drafts, not licensed financial advice.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/valu_app.py:1057
Finding

Batch Analysis Bypasses Quota and Billing Enforcement

Content
View full analysis
Dict[str, Any]: self.log.info(f"Starting batch analysis for {symbols}") max_stocks = self.config.batch_max_stocks if len(symbols) < 2: return {'success': False, 'error': 'At least 2 stocks required', 'error_code': 'INVALID_INPUT'} if len(symbols) > max_stocks: return {'success': False, 'error': f'Max {max_stocks} stocks allowed', 'error_code': 'INVALID_INPUT'} stock_results = [] for symbol in symbols: price_result = self.data_service.get_historical_prices(symbol) basic_result = self.data_service.get_basic_info(symbol) stock_results.append({ 'symbol': symbol, 'name': basic_result['data'].get('stock_name', symbol), 'price_data': price_result['data'] if price_result['success'] else None, 'basic_info': basic_result['data'], 'success': price_result['success'] }) time.sleep(0.5) comparator = StockComparator() comparison = comparator.compare_stocks(stock_results) report = comparator.generate_comparison_report() report = self.report_service.add_disclaimer(report) filepath = self.report_service.save_report(report, f"batch_{'_'.join(symbols)}") return { 'success': True, 'stocks': symbols, 'stocks_analyzed': len([s for s in stock_results if s['success']]), 'comparison': comparison, 'report': report, 'report_file': filepath } ``` Related batch authorization and charging functions exist in `scripts/valu_pricing.py:268-309`, but the application does not call them: ```python def can_use_batch(self, user_id: str) -> bool: user = self.quota_manager._init_user(user_id) if user.get("credits", 0) >= PRICING["batch_ ...[truncated 2128 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
scripts/valu_app.py:1120
Finding

Caller-Controlled User IDs Permit Unlimited Free-Quota Evasion

Content
View full analysis
Dict[str, Any]: if user_id not in self.user_db: self.user_db[user_id] = { "created_at": datetime.now().isoformat(), "last_active": datetime.now().isoformat(), "free_quota": { "used_this_week": 0, "week_key": self._get_week_key() }, "credits": 0, "packages": {}, "usage_history": [] } return self.user_db[user_id] ``` Quota decisions rely entirely on this unverified identity: ```python def check_can_analyze(self, user_id: str) -> tuple[bool, str]: user = self._init_user(user_id) self._reset_weekly_quota_if_needed(user) if user["free_quota"]["used_this_week"] < PRICING["free"]["quota_per_week"]: return True, "free_quota" if user["credits"] > 0: return True, "credits" for pkg_id, pkg_info in user["packages"].items(): if pkg_info["remaining"] > 0: return True, f"package_{pkg_id}" return False, "no_quota" ``` ### Technical Analysis A user ID is treated as both an account identifier and an authorization principal, but there is no authentication, signed session, password, API token, or stable platform identity binding. Because `_init_user()` automatically creates quota state for every new identifier, cal ...[truncated 1375 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/valu_app.py:640
Finding

Untrusted News Content Is Inserted into the AI Instruction Channel

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • 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
Findings (29)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill is presented as an analysis tool but also performs quota management, billing, package purchases, and persistent user-database storage that are not disclosed in the description. Hidden payment and user-data handling materially increases privacy and financial risk because users and integrators may not apply the controls expected for transactional or stateful systems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as an analysis tool but also performs quota management, billing, package purchases, and persistent user-database storage that are not disclosed in the description. Hidden payment and user-data handling materially increases privacy and financial risk because users and integrators may not apply the controls expected for transactional or stateful systems.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

The skill is presented as an analysis tool but also performs quota management, billing, package purchases, and persistent user-database storage that are not disclosed in the description. Hidden payment and user-data handling materially increases privacy and financial risk because users and integrators may not apply the controls expected for transactional or stateful systems.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
84% confidence
Finding

The skill advertises capabilities that imply network, filesystem, and possibly environment access, but it does not declare any explicit tool scope or permissions boundaries. This weakens least-privilege controls and makes it harder for a host system to constrain what the skill may access, increasing the blast radius if the skill or its dependencies behave unexpectedly.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Overly broad trigger keywords can cause the skill to activate in routine investing conversations where the user did not intend to invoke it. Unintended invocation can expose user inputs to external processing, trigger network requests, consume paid quotas, or generate misleading outputs in the wrong context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill content and user-facing description are entirely in Chinese and target A股/港股 analysis, but there is no statement that the skill supports other languages or that Chinese output is an intentional, user-selected locale. Under the policy, forcing a specific language without opt-in can be a natural-language policy violation unless the locale restriction is clearly documented and justified.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration sets language: "zh_CN", which imposes a specific locale in natural-language behavior. Under the policy, fixed language constraints should either be optional, user-selectable, or clearly justified as region-specific; this file provides no such opt-in or justification.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a professional stock valuation tool that constructs WACC sensitivity analysis, three-stage DCF valuation, and relative valuation cross-checks. In this file, the core analysis is performed by prompting an external LLM API and asking it to generate the valuation report, with no in-code DCF calculations, WACC model, or peer-multiple computation shown here.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
91% confidence
Finding

This code performs external network transmission to a configurable AI endpoint using a prompt that includes stock symbol, company details, financial summaries, and news context. External transmission is not inherently unsafe, but in this skill it is security-relevant because the transfer is not clearly surfaced to the user and could send sensitive or proprietary analysis context to a third party.

Content

Scanner excerpt · scripts/valu_app.py (reported line 619)May include surrounding context.

python
try:
            self.log.info("Calling AI model...")
            response = requests.post(self.ds_config.api_url, headers=headers, json=data, timeout=self.ds_config.timeout)
            response.raise_for_status()
            result = response.json()
            if "choices" in result and result["choices"]:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The application transmits analysis inputs, including user-provided symbol context and fetched company/financial/news data, to an external AI API without any explicit user consent flow or clear disclosure at the point of use. In a finance-focused skill, this creates a privacy and data-governance risk because users may reasonably expect local analysis rather than third-party processing.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The prompt hardcodes the report title, metadata, and output template in Chinese, directing the model to produce a Chinese-language report regardless of user preference. This is a natural-language locale constraint with no opt-in or documented justification in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The module description and all user-facing strings are written exclusively in Chinese, indicating the skill is designed to operate in a single language by default. Under the policy, forcing a specific language without user opt-in is a natural-language policy violation unless the locale constraint is explicitly documented and justified.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The report generator expects nested fields under comp['comparison'] (for example comp['comparison']['valuation_comparison']), but compare_stocks() stores those sections at the top level of the result object. This mismatch can cause runtime exceptions or incomplete reports, allowing a user-triggered denial of service of the skill's reporting path and producing misleading or missing analysis output in an investment context.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The default configuration sets the application language to "zh_CN", which is a natural-language locale constraint. The file does not provide any user opt-in, alternative locale selection, or justification that this is a region-specific tool, so it can violate language/locale policy expectations.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/config.yaml (reported line 14)May include surrounding context.

yaml
},
    "deepseek": {
        "api_key": "",
        "api_url": "https://api.deepseek.com/v1/chat/completions",
        "model": "deepseek-chat",
        "timeout": 180,
        "max_retries": 3

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/valu_config.py (reported line 24)May include surrounding context.

python
},
    "deepseek": {
        "api_key": "",
        "api_url": "https://api.deepseek.com/v1/chat/completions",
        "model": "deepseek-chat",
        "timeout": 180,
        "max_retries": 3

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/valu_config.py (reported line 70)May include surrounding context.

python
},
    "deepseek": {
        "api_key": "",
        "api_url": "https://api.deepseek.com/v1/chat/completions",
        "model": "deepseek-chat",
        "timeout": 180,
        "max_retries": 3

External Transmission

Medium
Category
Data Exfiltration
Confidence
60% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · scripts/valu_config.py (reported line 206)May include surrounding context.

python
},
    "deepseek": {
        "api_key": "",
        "api_url": "https://api.deepseek.com/v1/chat/completions",
        "model": "deepseek-chat",
        "timeout": 180,
        "max_retries": 3

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes a professional stock valuation and reporting tool, but this module embeds commercial pricing tiers, package discounts, and pay-per-use settings as first-class configuration. Monetization logic is not mentioned in the skill description and is semantically distinct from performing DCF, relative valuation, or financial analysis.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The manifest focuses on stock valuation, financial data retrieval, sensitivity analysis, and report generation, but this configuration also defines persistent user data storage. Retaining user data is a materially broader behavior than the stated analytics/reporting purpose and is not disclosed in the manifest description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The AppConfig dataclass sets language to zh_CN by default, reinforcing a forced locale choice in code. There is no accompanying logic or documentation in this file showing that users can select another language or that the restriction is required for compliance or scope.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The manifest advertises valuation analysis and report generation, but this module not only reads configuration but also creates report and user-data directories on disk and later supports saving configuration files. Report output may be expected, but generic user-data directory creation and config persistence broaden the operational behavior beyond what the manifest explains.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code file contains natural-language strings and docstrings in Chinese, including the module description and test output, without offering any user opt-in or locale selection. Under the policy rule for language/locale constraints, hardcoding a specific language can be a violation when no choice or region-specific justification is provided.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The file implements local user quota tracking, package purchases, credits, and billing persistence in a JSON file, which is materially outside the advertised stock valuation core logic. In an agent skill context, hidden monetization or account-state management expands the attack surface, creates privacy and integrity risks, and may enable unauthorized state changes or deceptive charging behavior if invoked by other components without strong authentication and storage controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The module title and description are written entirely in Chinese, and the surrounding user-facing strings throughout the file also assume Chinese as the required interaction language. This creates a natural-language locale policy issue because the skill does not offer a language choice or explain that it is intentionally limited to a Chinese-speaking/regional context.

Content

No source excerpt is available for this finding.