Back to skill

Security audit

AlphaPai 评论抓取

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real AlphaPai scraper, but it uses broad browser-session access and weak handling of authenticated content that users should review before installing.

Install only if you are comfortable giving the skill access to AlphaPai credentials or session files. Prefer a dedicated AlphaPai-only browser profile or scoped token, disable Chrome-profile fallback, remove ignore_https_errors behavior before logging in, keep Feishu disabled unless you trust the exact webhook, and treat saved storage-state/cookie files as credentials that need tight local protection and deletion when no longer needed.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
Findings (8)

T01 · Skill Instruction Hijacking

Error
Location
scripts/analyze.py:76
Finding

Indirect Prompt Injection Through Scraped AlphaPai Content

Content
View full analysis
str: target_length = int(settings["ai"]["target_length_chars"]) custom_requirements = str(settings["ai"].get("custom_requirements") or "").strip() custom_block = "" if custom_requirements: custom_block = f"\n额外格式要求:\n{custom_requirements}\n" return f"""你是一位擅长二级市场信息提炼的研究员,请把 Alpha派最近 {lookback_hours:g} 小时评论整理成一份适合手机阅读的中文摘要。 必须遵守以下格式和要求: 1. 总字数控制在 {target_length - 100} 到 {target_length + 150} 字。 ... 下面是原文: {content} """ def run_ai_analysis(prompt: str, settings: dict[str, Any]) -> str | None: model = settings["ai"]["model"] try: result = subprocess.run( [ "openclaw", "agent", "--message", prompt, "--model", model, ], capture_output=True, text=True, timeout=180, ) ``` ### Technical Analysis Content obtained from AlphaPai is interpolated verbatim into an instruction-bearing prompt and passed to `openclaw agent`. The prompt does not establish a strong trust boundary, identify the appended content as untrusted data, or instruct the model to ignore directives contained in that data. The historical-query path also calls `run_ai_analysis()` from `scripts/query_comments.py:146`, so previously archived attacker-controlled content can trigger the same condition. ### Attack Path 1. An attacker publishes an AlphaPai comment containing instructions directed at an AI model. 2. An authenticated user runs the scraper or searches an archive containing that comment. 3. The application inserts the comment directly into the prompt. 4. `openclaw agent` processes the embedded instructions ...[truncated 487 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/analyze.py:116
Finding

Default AI Summarization Exposes Scraped Account Content to an External Processing Path

Content
View full analysis
str | None: model = settings["ai"]["model"] try: result = subprocess.run( [ "openclaw", "agent", "--message", prompt, "--model", model, ], capture_output=True, text=True, timeout=180, ) except Exception: return None ``` ```python max_input_chars = int(settings["ai"]["max_input_chars"]) prompt = build_prompt(content[:max_input_chars], lookback_hours, settings) report = run_ai_analysis(prompt, settings) engine = "ai" if not report: report = fallback_analysis(content, lookback_hours) engine = "fallback" ``` ### Technical Analysis The normal scrape workflow invokes AI analysis by default. Up to `max_input_chars`, configured as 20,000 by default, is embedded in the message supplied to the configured model. The local fallback is used only after the AI command fails; there is no command-line option that disables AI processing while retaining report generation. Although the precise network behavior depends on the local OpenClaw configuration and selected model, the code deliberately transfers account-scoped source text to another processing component whose model may be remotely hosted. ### Attack Path 1. The user authenticates to AlphaPai and starts a normal scrape. 2. The scraper saves account-accessible comments to a raw file. 3. `generate_report()` reads the raw file and includes up to 20,000 characters in a prompt. 4. The prompt is passed to the configured OpenClaw model without per-run confirmation. 5. A remote model provider may receive and retain the material according to its own poli ...[truncated 263 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/scraper.py:140
Finding

TLS Certificate Validation Disabled During Authenticated Browser Sessions

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/bootstrap_session.py:54
Finding

Reusable Cookies and Browser Session State Stored as Unprotected Plaintext

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
scripts/scraper.py:122
Finding

Chrome Profile Fallback Exceeds the Access Needed for AlphaPai Scraping

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/send_feishu.py:22
Finding

Report Content Can Be Posted to an Arbitrary Webhook Destination

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/archive_store.py:167
Finding

Unpinned Dependencies and Model Artifacts Are Retrieved at Runtime

Content
View full analysis
Any | None: global _model if chromadb is None or SentenceTransformer is None: return None if _model is None: local_model_path = _resolve_local_model_path() if local_model_path is not None: os.environ.setdefault("HF_HUB_OFFLINE", "1") os.environ.setdefault("TRANSFORMERS_OFFLINE", "1") _model = SentenceTransformer( str(local_model_path), device=DEVICE, local_files_only=True, ) else: _model = SentenceTransformer(MODEL_NAME, device=DEVICE) return _model ``` The setup script also performs an unpinned global installation at `setup.sh:25-29`: ```bash pip3 install playwright --quiet python3 -m playwright install chromium ``` ### Technical Analysis When the model is absent from the local cache, `SentenceTransformer(MODEL_NAME)` may retrieve the current artifact associated with an unpinned model identifier. No revision or integrity hash is specified. Setup similarly installs whichever Playwright version is current and downloads its browser component. This makes reviewed behavior non-reproducible and exposes installation and vector-indexing operations to upstream compromise or incompatible future releases. ### Attack Path 1. The user runs setup or enables vector indexing without a cached model. 2. The tool contacts the package or model repository. 3. It retrieves an artifact not pinned to a reviewed version and hash. 4. A compromised or unexpectedly changed upstream artifact is installed or loaded. 5. The artifact executes or influences processing with the user's local privileges. ### Impact Assessment A compromised executable dependency could obtain the process's filesystem and network p ...[truncated 159 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/package_skill.py:14
Finding

Publication Packaging Uses an Incomplete Secret Filename Denylist

Content
View full analysis
set[str]: ignored = set() for name in names: if name in EXCLUDED_NAMES or name.startswith(".DS_Store"): ignored.add(name) return ignored ``` ```python dest = Path(args.dest).expanduser().resolve() if dest.exists(): shutil.rmtree(dest) dest.parent.mkdir(parents=True, exist_ok=True) shutil.copytree(SKILL_DIR, dest, ignore=ignore) ``` ### Technical Analysis The packaging process recursively copies the Skill and excludes only a small set of exact filenames. It does not categorically exclude runtime directories, raw reports, SQLite databases, vector indexes, Playwright storage-state files, `bootstrap_cookies.json`, renamed credential files, or arbitrary paths selected through configuration. The default output location is outside the Skill tree, reducing the default exposure, but the settings support configurable paths. If sensitive artifacts are placed inside the Skill directory, they can enter the distributable package. ### Attack Path 1. A user configures output or session storage inside the Skill directory, or manually places a sensitive artifact there. 2. The file does not match one of the exact denylisted names. 3. `package_skill.py` recursively copies it into the distribution directory. 4. `publish_skill.py` publishes that directory to ClawHub. 5. Downloaders can obtain the archived content or reusable session material. ### Impact Assessment Potential exposure includes AlphaPai cookies, storage state, credentials under nonstandard names, scraped propriet ...[truncated 98 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
Findings (44)

YARA rule 'info_stealer': Information stealer patterns (credential harvesting, browser data theft) [malware]

High
Category
YARA Match
Confidence
75% confidence
Finding

YARA rule matched a known malware signature (reverse shell, backdoor, ransomware, C2 framework, or info stealer).

Content

Scanner excerpt · README.md (reported line 5)May include surrounding context.

md
# AlphaPai 全市场点评抓取与检索 Skill

这个版本的升级,重点解决 9 件事:

1. 自动登录 Alpha派,支持 `USER_AUTH_TOKEN`、`cookies.json`、账号密码、storage state、Chrome Profile
2. 浏览器抓取有优先方案和备选方案,不再依赖单一路径
3. 原文、结构化记录、索引库、摘要保存到固定目录,便于归档和迁移
4. 支持“最近 N 小时”抓取,默认 1 小时
5. 每次抓取后会自动把每条点评拆成结构化记录并写入 SQLite + FTS5
6. 支持查询“最近 N 天关于某个主题/标的的所有点评”,默认 7 天
7. 生成手机友好的抓取摘要和查询摘要,强调增量信息和边际变化
8. 查询时支持 `exact / vector / hybrid` 三�

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding

This mismatch becomes security-relevant because the skill claims one business purpose while also instructing access to highly sensitive authentication materials such as tokens, cookies, browser profiles, storage state, and account credentials, without declaring permissions. When a skill understates or misstates such access, users may unknowingly authorize credential reuse and persistent local data collection beyond what they intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch becomes security-relevant because the skill claims one business purpose while also instructing access to highly sensitive authentication materials such as tokens, cookies, browser profiles, storage state, and account credentials, without declaring permissions. When a skill understates or misstates such access, users may unknowingly authorize credential reuse and persistent local data collection beyond what they intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch becomes security-relevant because the skill claims one business purpose while also instructing access to highly sensitive authentication materials such as tokens, cookies, browser profiles, storage state, and account credentials, without declaring permissions. When a skill understates or misstates such access, users may unknowingly authorize credential reuse and persistent local data collection beyond what they intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This mismatch becomes security-relevant because the skill claims one business purpose while also instructing access to highly sensitive authentication materials such as tokens, cookies, browser profiles, storage state, and account credentials, without declaring permissions. When a skill understates or misstates such access, users may unknowingly authorize credential reuse and persistent local data collection beyond what they intended.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

This mismatch becomes security-relevant because the skill claims one business purpose while also instructing access to highly sensitive authentication materials such as tokens, cookies, browser profiles, storage state, and account credentials, without declaring permissions. When a skill understates or misstates such access, users may unknowingly authorize credential reuse and persistent local data collection beyond what they intended.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/package_skill.py (reported line 19)May include surrounding context.

python
"token.local.json",
    "cookies.json",
    "cookies.local.json",
    "credentials.json",
    "credentials.local.json",
    "settings.json",
    "settings.local.json",

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The profile mode launches a persistent Chrome context against a user-supplied local profile directory, granting the scraper access to all cookies, sessions, and browser state present in that profile, not just AlphaPai authentication. In a skill context, this is overbroad privilege and can expose unrelated accounts and sensitive data if the skill is misconfigured, repurposed, or compromised.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README states that summaries are automatically sent to a Feishu webhook when configured, but it does not prominently warn that scraped content may be transmitted to an external service. Because the skill processes potentially sensitive research content and account-derived data, users may enable webhook delivery without realizing they are exporting data off-host.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding

The skill advertises and instructs use of capabilities including environment access, local file read/write, network access, and shell execution, but does not declare any explicit tool scope or permissions. That makes the trust boundary unclear and increases the risk that an agent executes sensitive operations such as reading credential files, reusing browser sessions, and invoking local scripts without informed user consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill encourages automated login using cached storage state, tokens, cookies, account credentials, and even the local Chrome profile, but does not prominently warn users about the sensitivity of those artifacts. This increases the chance of credential theft, session hijacking, or unintended access to unrelated accounts/data if the automation environment or stored files are compromised.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill enables implicit invocation without any visible trigger constraints, allowing the platform to call a login-and-scrape capability automatically based on broad prompt matching. Because this skill accesses an external site, scrapes content, and may send summaries onward, unexpected invocation increases the risk of unintended account use, data collection, or exfiltration without clear user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The prompt explicitly instructs the model to produce a Chinese summary (中文摘要), which imposes a specific language choice in natural-language behavior. There is no user opt-in or configurable language selection shown in this file, so this appears to violate the language/locale policy criteria.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script sends scraped Alpha派 content to an external AI agent process even though that behavior is not clearly reflected in the skill description presented to users. This creates an undisclosed data-flow boundary where potentially sensitive or licensed content leaves the local processing path, increasing privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/analyze.py (reported line 116)May include surrounding context.

python
def run_ai_analysis(prompt: str, settings: dict[str, Any]) -> str | None:
    model = settings["ai"]["model"]
    try:
        result = subprocess.run(
            [
                "openclaw",
                "agent",

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Raw scraped content is embedded into a prompt and passed to an external agent subprocess without any user-facing warning, confirmation, or consent. In this skill context, the content comes from a third-party research source, so undisclosed onward transmission can expose proprietary, sensitive, or access-controlled material to another processor.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

This code falls back to SentenceTransformer(MODEL_NAME, device=DEVICE) when no local model snapshot is found, which can download or contact remote model infrastructure. The file provides no confirmation prompt, print/log message, or inline warning that query/content data may be used in a network-backed model fetch path.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The function writes a JSON payload containing scraped records and metadata to normalized_path, which is a persistent file write affecting user/system data. There is no confirmation prompt, user-facing log/print, or warning comment/docstring near this operation explaining that content is being stored on disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script saves authenticated session cookies to a plaintext JSON backup file after login, which creates an additional credential-bearing artifact beyond Playwright's storage state. Anyone with local access to the runtime directory, backups, logs, or synced files could reuse these cookies to hijack the AlphaPai session, and the script gives no explicit warning or protection around this sensitive export.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

The code enables Feishu notifications when a webhook URL is present in the environment, which can cause scraped or derived data to be transmitted over the network. There is no visible confirmation, logging, or warning in this file that outbound delivery may occur.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code reads authentication material from token, cookie, credential, and browser storage-state files, which are sensitive data sources. The helper contains no confirmation prompt, logging, or user-facing comment/docstring warning that local credentials and session artifacts will be accessed.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

This code creates a settings file and may copy example token, cookies, and credentials files into local config paths. Although the module docstring says it initializes local settings, there is no explicit user-facing warning that credential-related files will be written or copied, which is relevant for a safety-sensitive file operation involving auth material.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/publish_skill.py (reported line 45)May include surrounding context.

python
def run_command(cmd: list[str]) -> None:
    subprocess.run(cmd, check=True)


def resolve_clawhub_bin() -> str | None:

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The prompt explicitly instructs the model to produce a Chinese summary and all required section headings are fixed in Chinese. This imposes a specific language choice on users without offering a language option or documenting that the tool is intended only for a Chinese-language context.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
87% confidence
Finding

The code builds an AppleScript command by directly interpolating the notification title and message into a script string, then passes it to osascript. Although subprocess.run is invoked without a shell, AppleScript itself is being interpreted, so unescaped quotes or crafted content from upstream data could break out of the intended notification string and alter script behavior.

Content

Scanner excerpt · scripts/run.py (reported line 29)May include surrounding context.

python
script = (
            f'display notification "{message}" with title "{title}" sound name "Glass"'
        )
        subprocess.run(["osascript", "-e", script], check=False, capture_output=True, text=True)
    except Exception:
        pass

Static analysis

No suspicious patterns detected.