Back to skill

Security audit

Byted Las Document Parse

Security checks for vulnerabilities and agentic risk

Overview

This is a real remote document parsing skill, but it can upload local documents and results, use powerful credentials with weak endpoint controls, and fetch remote result content without enough guardrails.

Install only if you are comfortable sending target documents, screenshots, extracted images, and parsed outputs to Volcengine LAS/TOS services. Use least-privilege LAS/TOS credentials, avoid untrusted env.sh files and custom endpoints, do not process sensitive documents without explicit approval, and disable long-image LLM cropping when extra image transmission is not acceptable.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/skill.py:238
Finding

LAS API Key Can Be Transmitted to an Arbitrary Custom Endpoint

Content
View full analysis
Dict[str, str]: return { "Content-Type": "application/json", "Authorization": f"Bearer {get_api_key()}", } ``` ```python def get_api_base(*, cli_api_base: Optional[str] = None, region: str = DEFAULT_REGION) -> str: if cli_api_base: return cli_api_base.rstrip("/") env_api_base = os.environ.get("LAS_API_BASE") if env_api_base: return env_api_base.rstrip("/") ``` ```python for attempt in range(1, max_attempts + 1): try: r = requests.post(url, headers=_headers(), json=payload, timeout=timeout_s) ``` ### Technical Analysis The `--api-base` command-line option and `LAS_API_BASE` environment variable accept an arbitrary URL. The value is not restricted to HTTPS, validated against an allowlist, or checked to ensure that it belongs to an official LAS domain. Every request made through `_post_json_with_retry()` receives the authorization header generated by `_headers()`. Consequently, a custom endpoint receives the user's complete `LAS_API_KEY` as a bearer credential. The environment-loading behavior increases the practical exposure because the program automatically reads `env.sh` from the Skill directory or current working directory. A malicious or unintentionally modified configuration file can therefore redirect authenticated traffic without requiring changes to the Python source. The same issue applies to redirects: the code does not explicitly disable redirects or validate their destinations. Credential handling across redirects consequently depends on the HTTP library's behavior rather than an explicit security policy. ### Attack Path 1. An attacker causes `LAS_API_BASE` to be set to an attacker-co ...[truncated 1093 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/save_utils.py:123
Finding

Unvalidated Result Image URLs Permit SSRF and Unbounded Disk Writes

Content
View full analysis
List[Dict[str, Any]]: """Extract all image URLs and position information from the complete API response.""" images: list[dict] = [] for page in res.get("data", {}).get("detail", []): page_id = page.get("page_id", 0) for block in page.get("text_blocks", []): if block.get("label") == "image" and block.get("url"): images.append({ "page": page_id, "url": block["url"], "box": block.get("box"), }) return images ``` ```python def _download_image(url: str, dest: Path, max_retries: int = 2) -> bool: """Download a single image locally with retries.""" import requests for attempt in range(max_retries + 1): try: r = requests.get(url, timeout=30, stream=True) r.raise_for_status() dest.parent.mkdir(parents=True, exist_ok=True) with open(dest, "wb") as f: for chunk in r.iter_content(chunk_size=8192): f.write(chunk) return True except Exception as e: if attempt < max_retries: time.sleep(1 * (attempt + 1)) continue print(f"✗ Download image failed: {url} -> {e}", file=__import__("sys").stderr) return False ``` ### Technical Analysis Image URLs are taken from the LAS API response and passed directly to `requests.get()`. The downloader does not validate: - The URL scheme. - The destination hostname. - Whether DNS resolves to a private, loopback, link-local, multicast, or reserved address. - Redirect destinations. - The response `Content-Type`. - The response `Co ...[truncated 2197 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/tos_utils.py:340
Finding

Long Images Are Sent to an Additional Multimodal Endpoint by Default

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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (50)

Tainted flow: 'endpoint' from os.environ.get (line 99, credential/environment) → requests.post (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/tos_utils.py (reported line 374)May include surrounding context.

python
for attempt in range(1, max_attempts + 1):
        try:
            _log(f"正在调用 LLM 获取智能裁剪位置 (attempt {attempt}/{max_attempts})...")
            response = requests.post(endpoint, headers=headers, json=payload, timeout=60)
            response.raise_for_status()

            result = response.json()

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This code chunk is a persistence/export utility, not a document parsing skill. Its main entrypoint save_parse_result expects a completed API response (res) that already contains data.markdown and page/block details. It then saves result.md and result.full.json, extracts image URLs from response blocks, downloads those images, rewrites Markdown links to local paths, writes an images.json manifest, creates a zip archive, and may upload the archive to TOS and generate a presigned URL. While these actions may support a larger PDF/image parsing workflow, the declared description says the skill is excellent at parsing/OCR/extracting content from PDFs and images and should trigger on those user inputs. None of that core parsing behavior appears in this code chunk. Instead, the chunk adds undeclared storage/archival/network-transfer behavior. Therefore the description does not accurately represent what this code actually does.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description presents this as a comprehensive parser/OCR skill for PDFs and images, including long screenshots, with automatic invocation whenever relevant files/paths/URLs are shared. The supplied code does support the general domain: it is clearly for PDF parsing, accepts URLs and likely local files through handle_url_input, includes ETA logic for local PDFs/images/long images, submits jobs to a LAS operator, polls status, and outputs markdown/results. However, there are material gaps between description and demonstrated behavior. First, no automatic trigger logic is implemented here; Triggers: [] and the code is only a CLI tool. Second, the description promises extraction of text, tables, and images, but the code only explicitly accesses data.markdown from the remote service response; table/image extraction is not evidenced in the shown code. Third, the primary implementation is orchestration of a remote service rather than direct parsing/OCR in the skill itself. These differences are significant enough to count as a description-behavior mismatch, though the skill is still broadly related to PDF/image parsing.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents this as a document/image parsing skill with OCR and structured Markdown extraction. The supplied code instead implements storage and preprocessing utilities: detecting local files, converting images to PDF, splitting long screenshots into pages, uploading files/bytes to TOS, generating presigned URLs, and counting PDF pages. While it does support long screenshots/images in the sense of converting and paginating them, the core advertised capability—reading document contents and extracting structured Markdown—is absent. This is a material description-behavior mismatch, with the actual primary purpose being file transport/preparation for downstream systems rather than document parsing.

Content

No source excerpt is available for this finding.

Vague Triggers

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is configured to trigger on very broad conditions such as any shared PDF/image path, URL, or TOS path, even when the user did not explicitly request parsing. In context, this is dangerous because the workflow can cause automatic submission of user-provided documents to an external service, increasing the risk of accidental data disclosure and unauthorized processing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill declares access to sensitive capabilities via environment variables and its documented workflow uses filesystem and network operations, but it does not declare any explicit tool scope or allowed-tools boundaries. This weakens least-privilege controls and makes unintended or excessive capability use harder to govern or audit, especially for a skill that can upload files and handle credentials.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documented workflow instructs the agent to upload local files, poll a remote API, save outputs, and optionally package and upload results to TOS, but it does not require an explicit warning or consent flow about transmission to third-party services. For a document-parsing skill that may process sensitive PDFs or images, this omission materially increases the risk of confidential data being sent off-device without informed user approval.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

Large portions of the operational instructions are written only in Chinese, while other parts are in English. This effectively imposes a language/locale constraint on users or maintainers without opt-in, and no region-specific justification is provided in the file.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The trigger evaluation examples activate on very broad phrases like 'parse this PDF', 'OCR this screenshot', and any local path/URL/TOS reference to a PDF or image, but they do not encode clear limiting rules about user intent, excluded operations, or disambiguation thresholds. In a skill that is mandated to auto-trigger for many common file mentions, this can cause over-triggering, unintended file handling, and routing of requests that only mention PDFs/images but do not actually request parsing or extraction.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The documentation states that when a local file path is supplied, the script will automatically upload the file to TOS and then submit the resulting remote object for parsing. In a document-parsing skill, users may reasonably expect local analysis, so failing to prominently warn that local PDFs/images are transmitted to remote storage and service endpoints creates a real privacy and data-handling risk, especially for sensitive documents.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill is presented as a document parsing capability, but the documentation also includes remote archival/upload to TOS. That creates a capability mismatch: parsed document contents and derived artifacts may be transferred to remote storage even though users may reasonably expect only local extraction, increasing confidentiality and data-governance risk.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documented check-and-notify workflow performs additional side effects beyond document parsing: it downloads extracted images locally, rewrites Markdown links, packages results, and may upload artifacts to TOS. In an agent context, these behaviors expand the data-handling surface and can unexpectedly copy or transmit user content, which is risky if not explicitly consented to and tightly scoped.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The documentation describes automatic local downloads, Markdown rewriting, and optional TOS upload, but does not clearly warn that local files will be created/modified and that results may be transmitted remotely. In an agent-driven workflow, insufficient disclosure of these side effects can cause unanticipated persistence or exfiltration of potentially sensitive parsed content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The documentation instructs users to configure API and storage credentials for local file uploads, but it does not warn that local PDFs/images may be transmitted to external LAS/TOS services. In a document parsing skill that auto-triggers on file paths and images, this omission can cause users to unknowingly send sensitive files or secrets to remote infrastructure, creating privacy and data-handling risk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The documentation states that when given a local file path, the script will automatically upload the file to TOS using configured credentials before submitting it for parsing. This creates a real data-handling risk because users may reasonably expect local parsing, while the skill silently transmits potentially sensitive local documents to remote storage and services without an explicit warning, consent step, or data classification guidance.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The code follows image URLs from the parse response and downloads them to local storage, adding network-fetch and file-write behavior beyond simple extraction. If the upstream response is compromised or overly trusted, this creates SSRF-like exposure to internal services, unexpected local persistence, and processing of attacker-controlled remote content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

Remote image downloads and local file writes happen automatically without an explicit user-facing warning or confirmation. In a parsing skill, that increases surprise and privacy risk because users may expect extraction only, not additional network activity and local artifact creation.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/save_utils.py (reported line 141)May include surrounding context.

python
if attempt < max_retries:
                time.sleep(1 * (attempt + 1))
                continue
            print(f"✗ 下载图片失败: {url} -> {e}", file=__import__("sys").stderr)
            return False

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/save_utils.py (reported line 224)May include surrounding context.

python
arcname = f"{task_id}/{file_path.relative_to(task_dir)}"
                zf.write(file_path, arcname)

    _log = lambda msg: __import__("builtins").print(msg, file=__import__("sys").stderr)
    zip_size_mb = zip_path.stat().st_size / 1024 / 1024
    _log(f"压缩包已创建: {zip_path} ({zip_size_mb:.2f} MB)")
    return zip_path

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill advertises parsing/extraction, but this code additionally archives all results to remote TOS storage and generates a presigned download URL. In a document-parsing context, this materially increases data-exfiltration and retention risk because parsed documents may contain sensitive content, and users may not expect automatic secondary storage or shareable links.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Uploading archived results to TOS and generating a presigned download URL without explicit user disclosure can expose sensitive parsed documents to unintended storage and sharing paths. In this skill’s context, documents and screenshots are likely to contain confidential business or personal data, making silent archival especially dangerous.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The utility writes the complete API response to disk as result.full.json, which may contain full extracted text, metadata, coordinates, image URLs, or other sensitive document contents. Persisting the complete response without clear disclosure or minimization increases confidentiality and retention risk, especially for OCR and document-processing workflows.

Content

No source excerpt is available for this finding.

Dynamic import via __import__()

Medium
Category
Dangerous Code Execution
Confidence
75% confidence
Finding

Dynamic import() can load arbitrary modules at runtime, bypassing static analysis and potentially importing malicious code.

Content

Scanner excerpt · scripts/save_utils.py (reported line 406)May include surrounding context.

python
result.update(tos_result)
        except Exception as e:
            result["tos_error"] = str(e)
            print(f"✗ TOS 归档失败: {e}", file=__import__("sys").stderr)


    # --- 安全兜底检查 ---

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The manifest describes a broad document/image parsing skill for PDFs, scanned images, standard images, and long screenshots. However, the module docstring identifies the skill as a PDF parser, and the core API calls always use the fixed operator_id 'las_pdf_parse_doubao' with CLI/help text centered on 'PDF 解析', so the implementation evidence does not clearly match the broader claimed image-parsing scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The module docstring and subsequent CLI/help/log messages are written exclusively in Chinese, which indicates the skill is designed to operate in a fixed language/locale. The policy allows locale constraints only when they are explicitly optional or clearly justified as region-specific; this file does not offer a user language choice or state that Chinese is a required locale for users.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.