Back to skill

Security audit

Shwuyeyanjiu

Security checks for vulnerabilities and agentic risk

Overview

The skill is not clearly malicious, but it ships extra batch scripts and unsafe local PDF handling that go beyond the stated project-level research workflow.

Review this skill carefully before installing. Run it only in an isolated workspace, avoid the batch and /tmp-scanning scripts unless you explicitly need them, and prefer a revised version that uses a private temporary directory, sanitized output paths, cleanup, locked dependencies, and clearly separated project-level versus district-wide workflows.

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

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/extract_contract_dates_v2.py:155
Finding

Predictable Files in a Shared Temporary Directory Permit Symlink Overwrites and Path Manipulation

Content
View full analysis
bool: """Download a PDF file.""" url = f"https://962121.fgj.sh.gov.cn/wyweb//web/UploadFiles/pdf/{pdf_id}.pdf" try: response = requests.get(url, timeout=30) if response.status_code == 200: with open(output_path, 'wb') as f: f.write(response.content) ``` ```python def process_project(project_name: str, output_dir: str = '/tmp') -> dict: """Process a single project.""" print(f"\nProcessing: {project_name}") announcements = search_project_announcements(project_name) # ... for ann in announcements['招标公告'][:1]: pdf_path = f"{output_dir}/{project_name}_招标_{ann['pdf_id']}.pdf" if download_pdf(ann['pdf_id'], pdf_path): text = ocr_pdf(pdf_path) # ... for ann in announcements['中标公告'][:1]: pdf_path = f"{output_dir}/{project_name}_中标_{ann['pdf_id']}.pdf" if download_pdf(ann['pdf_id'], pdf_path): text = ocr_pdf(pdf_path) ``` Equivalent predictable `/tmp` filename construction also appears in: - `scripts/batch_extract_dates.py:197, 218` - `scripts/batch_extract_dates_v2.py:206, 239` - `scripts/fetch_project.py:223` - `scripts/find_expiring_contracts_v4.py:225` - `scripts/find_expiring_contracts_v5.py:224` ### Technical Analysis The scripts construct filenames in the globally shared `/tmp` directory using project names and public PDF identifiers. They then open those paths with ordinary write-and-truncate semantics. There are no controls to: - Create a private per-run temporary directory. - Reject symbolic links. - Atomically create a previously nonexistent file. - Normalize and constrain the resolved path to the intended direct ...[truncated 2154 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/process_jingan_pdfs.py:136
Finding

Untrusted PDFs Are Automatically Discovered and Parsed from Global /tmp

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
package.json:14
Finding

Runtime Dependencies Are Mutable and Not Protected by a Lockfile or Integrity Hashes

Content
View full analysis
=2.31.0", "beautifulsoup4": ">=4.12.0", "pdf2image": ">=1.16.0", "pytesseract": ">=0.3.10", "python-dateutil": ">=2.8.0" } ``` The documentation also instructs users to resolve packages dynamically at runtime: ```bash uv run --with requests --with beautifulsoup4 python3 << 'EOF' ``` ```bash uv run --with pdf2image --with pytesseract --with pillow python3 << 'EOF' ``` ### Technical Analysis The Skill does not provide an audited Python lockfile or package hashes. Lower-bound-only constraints allow dependency resolution to select versions that did not exist when the Skill was reviewed. The documented `uv run --with` commands dynamically obtain packages from the configured package index. If a dependency account, release, package index, or local package-source configuration is compromised, installation or import of a malicious release can execute code with the Agent user's privileges. The project also declares Python packages in `package.json`, which normally describes npm dependencies. This creates ambiguous installation semantics and does not replace a Python dependency manifest such as `pyproject.toml` with a lockfile. No evidence was found that the listed package names are intentionally malicious or typosquatted. The issue is the lack of reproducibility and integrity controls, rather than a confirmed compromised dependency. ### Attack Path 1. A future dependency release or configured package source becomes compromised. 2. A user follows the documented `uv run --with` command or installs dependencies using unconstrained lower-bound specifications. 3. The resolver selects the compromised release because no ex ...[truncated 749 chars]
Remediation
View remediation
Vulnerability Patterns
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • 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 (50)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The skill claims to fetch announcement data from the website for fee analysis, but the described behavior instead processes local PDFs by filename convention and generates grouped expiration reporting. This kind of description-behavior mismatch is dangerous because it hides important operational details, including local file dependence and a different primary analysis objective.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill includes executable examples that use network access and write files locally, but it does not declare any explicit tool scope or permission boundaries. This increases the chance that an agent invokes broader capabilities than users expect, making unintended network fetches and filesystem writes harder to govern or audit.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions include broad keywords such as references to Shanghai property, bids, or property fees, which can overlap with ordinary conversation and cause accidental invocation. Misfires are risky because they may trigger network access, OCR, or local file operations without the user clearly intending to use this specific skill.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file docstring states it '批量提取静安区项目的合同到期时间', and the code extracts contract periods, bidding dates, and computes contract expiry dates for district-wide projects. The manifest, however, describes a tool for retrieving Shanghai property bidding/winning announcements, extracting project information such as area, property fee standards, parking data, and calculating saturation income; contract-expiry batch analysis is a materially different function not described there.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script persists downloaded PDFs under /tmp using unsanitized project names and writes a CSV report to a fixed user-specific path, creating unnecessary local data retention and filesystem side effects. In an agent context, this can expose scraped documents and derived project data to other local users/processes, and fixed-path writes can overwrite files or fail unpredictably outside the author’s environment.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The module docstring and implemented logic are centered on '批量提取...合同到期时间', extracting contract periods, bidding dates, and computing contract expiry dates. The manifest describes a tool for fetching Shanghai property bidding data, extracting fields like area, property fee standards, parking counts/fees, and calculating saturated revenue, which this script does not do.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The file-level description and processing logic are explicitly tied to Chinese-language content, and the OCR configuration later enforces Chinese recognition. This constitutes a locale/language constraint without any user 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
96% confidence
Finding

The OCR call hard-codes lang='chi_sim+eng', which forces a specific language setup and recognition policy. Under the policy rules, language constraints should be user-selectable or clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file-level documentation says the strategy is to download PDFs and use a PDF parsing tool to extract contract period and bidding date, while the broader skill documentation emphasizes OCR extraction from announcements. In code, extraction is done solely through pdfminer text parsing, with no OCR logic present, creating a clear documentation-to-implementation divergence if this file is presented as part of the OCR-based skill behavior.

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 a tool for retrieving Shanghai property tender/winning announcements, extracting project information such as area, property fee standards, parking spaces, and parking management fees, and calculating saturated revenue. This script instead derives contract period, extracts bidding/publication dates from PDFs, and computes a contract expiry date, which is a different analytical purpose not described in the manifest.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file's docstrings and all user-facing CLI messages are written exclusively in Chinese, which constitutes a language-policy issue under the rule when no user language choice is provided. There is no indication that the tool is region-locked or that Chinese-only output is a documented, justified constraint.

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 is entirely in Chinese and specifically targets Shanghai property tender notices, indicating a fixed language/locale context with no user choice or opt-in. The stated policy requires flagging language or locale constraints unless they are explicitly documented as justified or optional.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes a tool for retrieving Shanghai property tender/bid/result announcements, extracting project fields via OCR, and calculating saturation revenue. This file’s documented and implemented purpose is specifically to infer contract start/end dates and identify projects expiring in 2026, which is a distinct analytical use case not declared in the manifest description or trigger conditions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The code infers contract start and end dates using an internal heuristic ('announcement date plus one month, day one') when the source does not explicitly provide contract dates. Presenting derived dates as concrete outputs can mislead users and operationalize inaccurate contract-expiration intelligence, which is especially sensitive in procurement and vendor targeting contexts.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The script broadens the skill from project-specific property bidding/revenue lookup into district-wide identification of contracts expiring in 2026. That creates a surveillance and competitive-intelligence capability not clearly justified by the stated skill purpose, enabling bulk profiling of renewal opportunities and targeted outreach against many properties at once.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The OCR call hard-codes the language setting to 'chi_sim+eng', which imposes a specific language/locale behavior. The file does not offer user opt-in or configurability, nor does it document that the skill is intentionally limited to Chinese-language source documents.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
83% confidence
Finding

The manifest lists fetching announcements, extracting project information via OCR, and calculating saturation revenue, but does not mention inferring contract start/end dates or determining whether contracts expire within a target year. This adds an analysis function beyond the declared purpose of announcement lookup and fee/revenue extraction.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.