Back to skill

Security audit

网页新闻关键信息提取器

Security checks for vulnerabilities and agentic risk

Overview

This skill is a straightforward Chinese-language workflow for extracting public news items into a CSV or spreadsheet, with some quality and spreadsheet-safety caveats but no hidden persistence, credential access, or destructive behavior.

Install only if you are comfortable with a Chinese-focused skill fetching URLs you provide and producing CSV or spreadsheet files. Use it on public, non-sensitive pages, review generated rows before sharing, and sanitize spreadsheet values that begin with formula characters such as =, +, -, or @.

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)

T09 · Insecure Skill Coding Practices

Warning
Location
generate_excel.py:41
Finding

Spreadsheet Formula Injection Through Untrusted News Content

Content
View full analysis

Vulnerability Details

File Location: generate_excel.py:41-51
Related Input Instructions: skill.md:38-41,47-55
Vulnerability Type: Spreadsheet formula injection
Risk Level: Medium

Vulnerable Code

python
with open(csv_filepath, "r", encoding="utf-8-sig") as f:
    reader = csv.reader(f)
    headers = next(reader)
    for col_idx, header in enumerate(headers, 1):
        cell = ws.cell(row=1, column=col_idx, value=header)
        cell.font = Font(bold=True)
        cell.alignment = Alignment(horizontal='center')

    for row_idx, row in enumerate(reader, 2):
        for col_idx, value in enumerate(row, 1):
            ws.cell(row=row_idx, column=col_idx, value=value)

The Skill directs the agent to preserve information extracted from user-supplied webpages and export it as CSV or XLSX data. No validation or neutralization is applied before those values are assigned to spreadsheet cells.

Technical Analysis

Spreadsheet applications interpret values beginning with characters such as =, +, -, or @ as formulas in relevant contexts. In particular, openpyxl interprets a string beginning with = as a formula when it is assigned directly to a cell.

An attacker controlling a source webpage can place a formula payload in a news title, date, or summary. The extraction workflow may preserve that value in the intermediate CSV. The helper script then copies the value directly into an XLSX cell without forcing the cell type to text.

A representative malicious source value could be:

text
=HYPERLINK("https://attacker.example/collect","News item")

The precise effects depend on the spreadsheet client and its security configuration. Modern spreadsheet software may warn users or restrict dangerous functionality, but external-resource formulas can still create disclosure or tracking risks.

Attack Path

  1. An attacker publishes or modifies a webpage containing a n ...[truncated 1312 chars]
Remediation
View remediation

Remediation Suggestions

  • Treat every extracted date, headline, summary, and CSV field as untrusted input.
  • Neutralize cells beginning with =, +, -, or @ by prefixing them with an apostrophe before CSV or XLSX export.
  • Explicitly force imported values to be stored as text rather than allowing openpyxl to infer formulas.
  • Apply the same sanitization to headers and data rows.
  • Add regression tests for all recognized formula prefixes, including leading whitespace and control characters.
  • Document that generated CSV files must not contain active formulas.

Example hardening logic:

python
DANGEROUS_PREFIXES = ("=", "+", "-", "@")

def sanitize_spreadsheet_value(value):
    if not isinstance(value, str):
        return value

    candidate = value.lstrip()
    if candidate.startswith(DANGEROUS_PREFIXES):
        return "'" + value
    return value

for row_idx, row in enumerate(reader, 2):
    for col_idx, value in enumerate(row, 1):
        cell = ws.cell(
            row=row_idx,
            column=col_idx,
            value=sanitize_spreadsheet_value(value),
        )
        cell.data_type = "s"

T08 · Insecure Dependencies

Note
Location
usage.md:24
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis

Vulnerability Details

File Location: usage.md:24
Vulnerability Type: Unpinned dependency and non-reproducible installation
Risk Level: Low

Vulnerable Code

bash
pip install openpyxl

Technical Analysis

The installation instruction retrieves whichever version of openpyxl the configured Python package index resolves at installation time. It does not constrain the package to a reviewed version, verify an artifact hash, or use a lock file.

This makes installations non-reproducible and allows future, incompatible, or compromised package releases to enter the environment without another review of this project. The risk is greater when users have configured untrusted package indexes or mirrors.

No evidence was found that openpyxl is currently malicious. The issue is the absence of dependency integrity and version controls rather than a confirmed malicious package.

Attack Path

  1. A user follows the documented installation command.
  2. pip queries the user's configured package index or mirror.
  3. The index resolves a mutable, unpinned version of openpyxl and its transitive dependencies.
  4. A compromised index, compromised future release, or unsafe dependency version is downloaded.
  5. Package installation or later import executes the affected package code in the user's Python environment.

Impact Assessment

If the resolved package or one of its dependencies were compromised, code could execute with the privileges of the account running pip or the conversion script. Potential scope includes:

  • Reading or modifying files accessible to that account.
  • Accessing environment variables and local application data.
  • Making outbound network connections.
  • Modifying the active Python environment.
  • Obtaining broader system access if the user runs the installation with administrative privileges.

The documented command does not request administrative privileges, and exploitati ...[truncated 65 chars]

Remediation
View remediation

Remediation Suggestions

  • Pin openpyxl to a specific reviewed version.
  • Record all transitive dependencies in a lock file.
  • Use hash verification through a requirements file generated from trusted artifacts.
  • Install dependencies inside an isolated virtual environment under a non-administrative account.
  • Use only trusted package indexes and explicitly configure the expected index URL.
  • Periodically review and update the pinned dependency after security testing.

Example installation workflow:

bash
python -m venv .venv
. .venv/bin/activate
python -m pip install --require-hashes -r requirements.txt

The requirements file should contain an explicitly reviewed version and verified hashes:

text
openpyxl==REVIEWED_VERSION \
    --hash=sha256:VERIFIED_DISTRIBUTION_HASH
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (8)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个端到端的网页新闻信息提取并生成Excel的技能;而提供的代码块只是一个辅助脚本,用于把输入CSV转换为Excel文件。它依赖命令行参数提供输入/输出文件路径,读取本地CSV,写入Excel并做简单格式化。代码没有任何网络请求、HTML解析、文本抽取、摘要生成或按网址逐篇处理的逻辑,因此其实际行为仅覆盖了“生成Excel”的最后一步,和声明的核心能力存在实质性不一致。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The docstring, argparse description, argument help text, worksheet title, and console messages are all written only in Chinese. The policy scope includes language/locale violations across all file types, and this file does not offer any user opt-in, alternative locale, or justification that the tool is intended only for a Chinese-speaking or region-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The natural-language instructions present the skill entirely in Chinese and specify Chinese column/output examples such as "时间" and "事件简介" and a Chinese filename, with no indication that users may choose another language or locale. Under SQP-3, forcing a specific language without user opt-in is a policy concern unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest describes the skill as producing an Excel file directly, but the usage instructions state that the skill outputs a CSV table and requires a separate helper script to convert it into a standard Excel file. This is a semantic mismatch in the advertised behavior, not just an implementation detail, because the final output format is central to the skill's stated purpose.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

Within the provided skill documentation context, the intended output is described as an Excel file, yet the usage instructions explicitly say Claude outputs CSV and only an additional script can create an Excel workbook. This is an active contradiction about what the skill itself produces, not merely omitted detail.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The FAQ states that the skill is mainly designed for Chinese and describes different behavior for English webpages, which signals a built-in language/locale preference. This can be a natural-language policy issue because it constrains language handling without offering the user an explicit choice or documenting a justified regional limitation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The documentation says the skill will automatically access user-provided webpages without warning that network requests will occur. This can create privacy and operational risk because users may unknowingly cause external requests to internal, sensitive, or tracking-enabled URLs.

Content

No source excerpt is available for this finding.