Back to skill

Security audit

Visible Text Extractor

Security checks for vulnerabilities and agentic risk

Overview

The skill has a coherent text-extraction purpose, but it needs review because it can fetch and render arbitrary pages, run an unsandboxed browser, rely on mutable external scripts, and optionally send generated documents to Feishu.

Install only if you are comfortable letting the skill fetch public URLs, download linked images, run browser/OCR/ffmpeg subprocesses, and write extracted content to local output files. Avoid using it on sensitive, authenticated, internal-network, or confidential pages unless you can sandbox network and browser execution. Do not use the Feishu send option unless the destination, identity, and contents are explicitly approved.

Vulnerability Patterns
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • 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 (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/extract_visible_text.py:43
Finding

Unrestricted URL Fetching Enables Server-Side Request Forgery

Content
View full analysis
str: req = Request(url, headers={'User-Agent': user_agent}) with urlopen(req) as resp: charset = resp.headers.get_content_charset() or 'utf-8' return resp.read().decode(charset, errors='replace') ``` ```python def download_file(url: str, suffix=''): req = Request(url, headers={'User-Agent': UA}) with urlopen(req) as resp: data = resp.read() ctype = resp.headers.get('Content-Type', '') if not suffix: path = urlparse(url).path.lower() for ext in ['.png', '.jpg', '.jpeg', '.webp', '.bmp', '.gif', '.svg']: if path.endswith(ext): suffix = ext break if not suffix: if 'png' in ctype: suffix = '.png' elif 'jpeg' in ctype or 'jpg' in ctype: suffix = '.jpg' elif 'webp' in ctype: suffix = '.webp' elif 'gif' in ctype: suffix = '.gif' elif 'svg' in ctype: suffix = '.svg' else: suffix = '.bin' fd, tmp = tempfile.mkstemp(prefix='visible-text-', suffix=suffix) os.close(fd) Path(tmp).write_bytes(data) return tmp ``` ### Technical Analysis The Skill accepts a user-controlled `--url` and passes it directly to `urllib.request.urlopen`. It also parses image URLs from untrusted HTML and downloads those URLs when `--ocr-images` is enabled. There is no validation of: - The URL scheme - The destination hostname - The resolved IP address - Redirect destinations - Network ports - Embedded URL credentials - Loopback, link-local, private, reserve ...[truncated 2018 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/extract_with_browser.js:43
Finding

Chromium Sandbox Disabled While Rendering Untrusted Webpages

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract_visible_text.py:349
Finding

Race-Prone Temporary Files Expose Captured Content and Permit File Replacement

Content
View full analysis
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Warning
Location
scripts/extract_visible_text.py:17
Finding

Execution of Mutable External Workspace Scripts Creates a Tool-Hijacking Boundary

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (68)

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Most description/behavior mismatch findings are not security bugs, but this variant explicitly mentions external Feishu delivery that is not declared in the stated purpose. Undocumented outbound delivery channels can enable unintended data exfiltration of extracted webpage or OCR content, especially when the skill handles user-provided or sensitive documents.

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 network access, shell execution, file reads/writes, and likely environment access, but the manifest does not declare any explicit tool scope or allowed-tools boundary. In an agent ecosystem, this weakens least-privilege controls and makes it harder to review or enforce what the skill is permitted to do, increasing the blast radius if the skill is misused or later modified.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The browser-fallback and page-screenshot OCR workflow may process full rendered pages, including visible sensitive information such as account data, personal information, or paywalled/private content exposed in the browser session. Without an explicit warning, users may unintentionally capture and persist sensitive page content in OCR outputs, screenshots, or downstream deliverables.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The spec explicitly instructs the skill to fetch/render pages and download every discovered image, but it does not require any user-facing notice, consent boundary, or restriction on when network access occurs. In an agent setting, this can cause unintended outbound requests, transfer of sensitive URLs or tokens to third-party hosts, and excessive data retrieval from untrusted pages, especially when processing screenshots, saved HTML, or local assets that may reference remote resources.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script includes an outbound file-delivery path to Feishu, which expands a local extraction workflow into external data transmission. Because the generated DOCX may contain scraped page contents, screenshots, OCR results, or other sensitive material, this creates an exfiltration surface inconsistent with a narrowly scoped text-extraction skill.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The maybe_send_to_feishu function operationalizes outbound file transfer using a receive ID and an external sender script, enabling the skill to move generated documents off-system. In the context of visible-text extraction, this capability is not necessary to perform extraction itself and increases the risk of unintended disclosure of processed content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The Feishu transmission path is invoked based on a parameter but the script itself provides no in-flow disclosure or warning that processed content will be uploaded to an external service. This weakens informed consent and can cause users or downstream agents to send extracted documents containing sensitive webpage text or images without adequate awareness.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script embeds Chinese-only credit markers such as '来源:' and '审核:' to detect content structure, and later emits Chinese section headings like '图片' for output. This enforces a specific language/locale behavior with no user opt-in or documented justification in the file, which matches the language/locale policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The helper runs multiple external programs through subprocesses, including ffmpeg, Node-based OCR, DOCX generation, and Feishu file sending, but the file provides no docstring or comment warning that external tools will be executed. Although some progress logs exist, they do not disclose the broader behavior of invoking local executables and downstream send operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script fetches remote image URLs via HTTP and writes the downloaded content to disk, but there is no docstring, comment, or user-facing disclosure explaining that external network requests will be made for each image. The visible logs only mention 'download' and do not warn that article-linked URLs will be contacted and content saved locally.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script can transmit generated documents to Feishu via an optional receive ID, which creates an external exfiltration path for extracted webpage and OCR content. Because the skill's primary purpose is text extraction, outbound document delivery expands data handling in a way that can leak sensitive content if invoked without clear user consent or proper policy controls.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The manifest emphasizes extracting, cleaning, deduplicating, and structuring visible text, but this code also writes markdown/JSON/DOCX deliverables and can send the DOCX to Feishu. While local output formatting may be adjacent to extraction, external distribution materially broadens the operational behavior beyond the described extractor role.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script writes multiple output artifacts to disk and creates parent directories automatically, but there is no user-facing warning or inline documentation explaining these file-system side effects. This qualifies as a safety-relevant file write operation lacking disclosure beyond the bare output-path arguments.

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/build_wechat_image_two_pass_docx.py (reported line 73)May include surrounding context.

python
def fast_ocr(image_path: Path):
    proc = subprocess.run(
        ['node', str(OCR_LOCAL), str(image_path), '--lang', 'chi_sim+eng', '--json'],
        capture_output=True, text=True, timeout=180
    )

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/build_wechat_ordered_clean_docx.py (reported line 90)May include surrounding context.

python
def fast_ocr(image_path: Path):
    proc = subprocess.run(
        ['node', str(OCR_LOCAL), str(image_path), '--lang', 'chi_sim+eng', '--json'],
        capture_output=True, text=True, timeout=180
    )

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
87% confidence
Finding

This high-OCR path uses tempfile.mktemp to generate an output filename before passing it to another process. mktemp is race-prone: a local attacker could pre-create or replace that path with a symlink before the OCR subprocess writes to it, potentially causing unintended file overwrite or reading attacker-controlled content.

Content

Scanner excerpt · scripts/build_wechat_image_two_pass_docx.py (reported line 91)May include surrounding context.

python
return {'ok': False, 'text': '', 'error': 'high ocr unavailable'}
    out = Path(tempfile.mktemp(prefix='two-pass-high-', suffix='.json'))
    try:
        proc = subprocess.run(
            [str(HIGH_OCR_PY), str(HIGH_OCR), str(image_path), '--output', str(out)],
            capture_output=True, text=True, timeout=90
        )

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/build_wechat_image_two_pass_docx.py (reported line 209)May include surrounding context.

python
md_path.write_text(build_markdown(title, polished), encoding='utf-8')
    json_path.write_text(json.dumps({'title': title, 'flow': polished}, ensure_ascii=False, indent=2), encoding='utf-8')

    proc = subprocess.run(['node', str(DOCX), str(md_path), str(docx_path)], capture_output=True, text=True, timeout=300)
    if proc.returncode != 0:
        raise SystemExit((proc.stderr or proc.stdout or 'docx build failed').strip())
    print(json.dumps({'ok': True, 'md': str(md_path), 'json': str(json_path), 'docx': str(docx_path)}, ensure_ascii=False, indent=2))

Static analysis

No suspicious patterns detected.